dict()
{}
my_phone = {'brand' : 'apple','model' : 'iphone X', 'year' : 2018}
my_phone
{'brand': 'apple', 'model': 'iphone X', 'year': 2018}
my_phone['brand']
'apple'
my_phone['model']
'iphone X'
my_phone['year']
2018
my_phone.get('brand')
'apple'
my_phone.get('color')
'red'
my_phone
{'brand': 'apple', 'model': 'iphone X', 'year': 2018}
my_phone['model'] = "iphone 12"
my_phone
{'brand': 'apple', 'model': 'iphone 12', 'year': 2018}
my_phone['year'] = 2021
my_phone
{'brand': 'apple', 'model': 'iphone 12', 'year': 2021}
my_phone['color'] = 'red'
my_phone
{'brand': 'apple', 'model': 'iphone 12', 'year': 2021, 'color': 'red'}
del my_phone['model']
my_phone
{'brand': 'apple', 'year': 2021, 'color': 'red'}
my_phone.keys()
dict_keys(['brand', 'year', 'color'])
my_phone.values()
dict_values(['apple', 2021, 'red'])
my_phone.items()
dict_items([('brand', 'apple'), ('year', 2021), ('color', 'red')])
'brand' in my_phone
True
'brand' not in my_phone
False
'apple' in my_phone.values()
True
my_list = [1,2,3,4,5]
my_list.clear()
my_list
[]
my_phone.clear()
my_phone
{}
True or False
True