Defining Dictionaries: shows an example of a dictionary definition. : Dictionary Declaration « Dictionary « Python






Defining Dictionaries: shows an example of a dictionary definition.


d = {"A":"a", "B":"b"}     
print d 

print d["A"]                                        

print d["B"]                                      

           
       








Related examples in the same category

1.Dictionaries are indexed by keys, which can be any immutable type
2.dict() constructor builds dictionaries directly from lists of key-value pairs