Remove Keys from Dictionary - Python
Posté 2023-02-23 23:16:41
0
11KB
In order to delete keys from the diction, you would have to use 'del'. Here's an example:
x = {123: 456}
del x[123]
print(x)
>> {}
If the key doesn't exist in the dictionary, it'll throw an KeyError exception.
Rechercher
Catégories
- Arts
- Business
- Computers
- Jeux
- Health
- Domicile
- Kids and Teens
- Argent
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
15 Iconic Guerrilla Marketing Examples That Shocked, Delighted, and Went Viral
Introduction
In marketing, creativity often matters more than cash. While traditional campaigns...
TMJ4 Live TV in Milwaukee, Wisconsin, USA
TMJ4 was the first commercial TV station in Wisconsin, hitting the airwaves on December 3, 1947....
6 ideas to give to improve health
New Year is a holiday that is most often celebrated in the circle of the closest people.
We have...
TOP 15 Research Universities
The world was built as the product of intensive research. Most of the world's stunning...
The Conjuring: The Devil Made Me Do It (2021)
A chilling story of terror, murder and unknown evil that shocked even experienced real-life...