Remove Keys from Dictionary - Python
Posté 2023-02-23 23:16:41
0
12KB
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
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
Misbehaviour. (2020)
A group of women hatch a plan to disrupt the 1970 Miss World beauty competition in London.
My...
How Do Startup CEOs Manage Work-Life Balance?
In the high-octane world of startups, where agility and rapid decision-making are often the keys...
Exploring the World of Scouting: The Art of Recreation
Exploring the World of Scouting: The Art of Recreation
Scouting, with its ethos of outdoor...
The tradeoff between economic output and environmental protection
Key points
Depending on their income levels and political preferences, different...
The secret of eternal youth. What are the causes of human aging and death?
We age for a reason, but as a result of a special biological program. But there is an African...