Python Training Topics
Python Training Topics
Python
Dictionaries
objectives
1.
AVD
Dictionary indexing
if 'five' in eng2sp:
print eng2sp['five']
print eng2sp.get('five')
The in operator
Note that the in operator works differently for dictionaries
than for other sequences
For offset indexed sequences (strings, lists, tuples), x
in y checks to see whether x is an item in the sequence
For dictionaries, x in y checks to see whether x is a
key in the dictionary
Thank You