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
Exit Through the Gift Shop (2010)
Following the style of some of the world's most prolific street artists, an amateur filmmaker...
What Is Marketing? Understanding the Core Principles, Scope, and Role in Business
Introduction: The True Meaning of Marketing
Ask ten people what marketing is, and you’ll...
CYC - Christian Youth Channel. Live TV. USA.
Christian Youth Channel – CYC aka Coptic Youth Channel, is a free-to-air English Coptic...
How to Plan a Guerrilla Marketing Campaign
From idea generation to execution: a step-by-step guide.
Introduction: Turning Creativity into...
Do Men and Women Earn the Same Salary?
Do Men and Women Earn the Same Salary?
The question of whether men and women earn the same...