Create dictionary - by using numbers, symbols or anything

PHOTO EMBED

Tue Apr 21 2020 05:10:22 GMT+0000 (Coordinated Universal Time)

Saved by @Hitech #python #python #dictionary

>>> stuff = {‘name’ : ‘Zed’, ‘age’ : 39, ‘height’ : 6 * 12 +1}
>>. print(stuff [‘name’])
Zed
>>> print(stuff [‘age’])
39
>>> print(stuff [‘height’])
74
>>> stuff [‘city’] = “SF”
>>. print(stuff[‘city’])
SF
                                
                                
content_copyCOPY

The above code is a simple dictionary. We can use anything in dictionaty like numbers, symbols, words etc then we can print the statements we want by using print command.

https://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914