Dictionaries: Deleting items
Syntax: del list[key]
- E.g.
>>> d = {'item':'tire','price':20.99}
>>> del d['item']
>>> d
{'price': 20.989999999999998}
>>> del d['brand']
Traceback (most recent call last):
File "", line 1, in ?
del d['brand']
KeyError: brand