jerry-git / learn-python3

Jupyter notebooks for teaching/learning Python 3
MIT License
6.43k stars 1.77k forks source link

Adding popitem to dictionaries notebook #14

Open sarithdm opened 4 years ago

sarithdm commented 4 years ago

I suggest you add this popitem also in dictionaries

my_dict = dict(food='ham', drink='beer', sport='football') print('dict before pops: {}'.format(my_dict))

result = my_dict.popitem() print('Result: {}'.format(result)) print('dict after popping items: {}'.format(my_dict))