In [2]:
empty_dictionary = {}
print empty_dictionary
In [3]:
filled_dictionary = {'first_name': 'abhinav', 'last_name': 'upadhyay'}
print filled_dictionary
In [4]:
food_menu = {}
food_menu['pizza'] = 300
food_menu['sandwich'] = 30
food_menu['tea'] = 10
print food_menu
Notice the ordering of the items in the output above
In [5]:
pizza_price = food_menu['pizza']
print pizza_price
In [6]:
tea_price = food_menu['tea']
print tea_price
In [10]:
food_menu.pop('tea')
print food_menu
In [ ]: