Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
11K
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
FOX Weather Live TV USA
Streaming 24/7 from America's Weather Center.Fox Weather is a digital broadcast television...
The Wolf of Wall Street. (2013)
Based on the true story of Jordan Belfort, from his rise to a wealthy stock-broker living the...
How to Make Your Home Cozier, Designer's Tips
How to Make Your Home Cozier, Designer's Tips
Cozy home design is an interior decoration...
Soaring Through Time: The Art of Recreating Kites
Soaring Through Time: The Art of Recreating Kites
From the serene flight of a bird-shaped kite...
How do I organize a support group?
In this article, we will talk mainly about the so-called peer support groups, in which...