Remove Keys from Dictionary - Python
Posté 2023-02-23 23:16:41
0
13KB
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
What is the Best Business Planning Software?
When it comes to starting a new business or refining an existing one, creating a comprehensive...
What is the best memory training app?
The mind is not a warehouse, and it is certainly not a hard drive. We operate under the...
Первый Музыкальный канал, прямой эфир. Беларусь
«Первый музыкальный» — музыкальный телеканал из Беларуси. Телеканал транслирует...
Promising Young Woman. (2020)
Pushing thirty, and defined by a hideous crime involving her bosom friend, Nina, emotionally...
The Importance of Art Education: Cultivating Creativity and Critical Thinking
Art education is a vital component of a well-rounded academic curriculum. While subjects like...