Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
6K
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.
Search
Categories
- Arts
- Business
- Computers
- Games
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
Double Indemnity. (1944)
A Los Angeles insurance representative lets an alluring housewife seduce him into a scheme of...
Лабиринт фавна. Pan's Labyrinth. (2006)
Испания, 1944 год. Группа повстанцев сражается с фашистами в горных лесах северной Наварры....
Arts and Crafts
Arts & Crafts was an English art movement of the Victorian era (late nineteenth century),...
10 countries with the largest gold reserves.
At the end of 2023, central banks around the world purchased 1037 tons of gold, the second...
Охотник на оленей. The Deer Hunter. (1978)
История о трех американцах русского происхождения - их жизни до, во время и после войны во...