Dict = , {Trial:2, {John:4, Harry: 3, Dick: 2}}}
NewDict = {}
for Trial, TValue in Dict.items():
for Name, Value in TValue.items():
TValue[Name] = random.random()
NewDict[Trial]= TValue
print(NewDict)
#My output will be something like else this:
Dict = , {Trial:2, {John:3, Harry: 4, Dick: 5}}}
#What I want is all my values in the dictionary are different.
#Eg.
Dict = , {Trial:2, {John:7, Harry: 2, Dick: 3}}}
Aucun commentaire:
Enregistrer un commentaire