Remove Keys from Dictionary - Python
Сообщение 2023-02-23 23:16:41
0
13Кб
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.
Поиск
Категории
- Arts
- Business
- Computers
- Игры
- Health
- Главная
- Kids and Teens
- Деньги
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
Schizophrenia Management
The primary treatment of schizophrenia is the use of antipsychotic medications, often in...
CGTN news (English) Live TV from China.
CGTN news, China Central Television (former CCTV 9) is a 24/7 news TV channel in the English...
Who Can Benefit from Mentoring?
Mentoring is often associated with early-career professionals, but its value extends far beyond...
Flying Discs - Discus Throwing
Dysk throwing is a discipline in athletics, consisting in throwing a special sports projectile -...
How Do Remote Teams Affect Knowledge Capital?
The rise of remote work has fundamentally transformed how organizations operate, communicate, and...