Remove Keys from Dictionary - Python
Veröffentlicht 2023-02-23 23:16:41
0
10KB
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.
Suche
Kategorien
- Arts
- Business
- Computers
- Spiele
- Health
- Startseite
- Kids and Teens
- Geld
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
Profession head-hunter
A head hunter is a specialist in finding candidates for key, responsible and high positions for...
ABC 13. KTNV Las Vegas Live TV. USA
KTNV-TV, channel 13, is an ABC-affiliated television station located in Las Vegas, Nevada, United...
Первый канал. Прямой эфир
Ежедневно в эфире Первого лучшие развлекательные шоу, уникальные документальные передачи, свежие...
10 Tips for Successfully Buying Clothes Online
More than 50% of purchases are now made online. This is beneficial for everyone: shop owners may...
Autism Spectrum: Misdiagnosis
There is a significant level of misdiagnosis of autism in neurodevelopmentally typical children;...