I am trying to create a dictionary or list in python.
The normal way for creating a dictionary is test = {}
but I don't want to name the dictionary test
.
For example I want to name the dictionary a random hash that I generate.
bagel = "bagels"
h = hashlib.md5()
h.update(bagel.encode('utf-8'))
print(h.hexdigest())
I then want to create the dictionary from the h.hexdigest
variable.
h.hexdigest() = {}
But this will not create the dictionary with the hash I just generated.
Does anyone know how I can do this?