how to store the variable in dictionary

Solutions on MaxInterview for how to store the variable in dictionary by the best coders in the world

showing results for - "how to store the variable in dictionary"
Jodi
25 Jul 2019
1>>> mydict = {"message": {"hello": 123456}}
2>>> print(mydict['message'])
3{'hello': 123456}
4>>> print(mydict['message']['hello'])
5123456
6
Jimmy
22 Jan 2020
1>>> mydict = {'a': 'hello', 'b': 'world'}
2>>> for x in mydict:
3...    val = mydict[x]
4...    mydict[x] = val.upper()
5...    print('Changed what', x, 'points to: from', val, 'to', mydict[x])
6Changed what b points to: from world to WORLD
7Changed what a points to: from hello to HELLO
8
similar questions
queries leading to this page
how to store the variable in dictionary