{'name': 'Arun Koundinya', 'age': 37, 'birthcountry': 'India'}
Season 02 - Introduction to Python Programming
DICTIONARIES
{'name': 'Arun Koundinya', 'age': 37, 'birthcountry': 'India'}
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-4-2e042f7087f7> in <cell line: 1>() ----> 1 my_dict[0] KeyError: 0
{'name': 'Arun Koundinya', 'age': 37, 'birthcountry': 'India', 'love': 'life'}
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-24-62e4795c3a60> in <cell line: 2>() 1 my_list = [1,2] ----> 2 dict(my_list) TypeError: cannot convert dictionary update sequence element #0 to a sequence
key: apple value: 5
key: banana value: 7
key: orange value: 3
key: kiwi value: 10
{'blueberries': 50, 'grapes': 500, 'watermelon': 1}
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-50-5159f89235ff> in <cell line: 1>() ----> 1 dummy_dict + new_dict TypeError: unsupported operand type(s) for +: 'dict' and 'dict'
{'apple': 5, 'banana': 7, 'orange': 3, 'kiwi': 10, 'blackberries': 50, 'blueberries': 50, 'grapes': 500, 'watermelon': 1}