How to delete an item from a dictionary in Python

preview_player
Показать описание


Code from video:
*****************
employees= {1: 'michael', 2: 'eric', 3: 'michael'}
del employees[2]
employees

Connect with us!
*****************
Рекомендации по теме
Комментарии
Автор

That's how you delete a Key from a dictionary. But how can you delete an item from it? For example, I have {cars:[black, gray]}, but just want to remove 1 item (i.e audi)

jag