Remove Keys from Dictionary - Python
Postado 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.
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
WGN Live TV. Chicago, Illinois, USA.
WGN-TV, is a CW-affiliated television station locatedin Chicago, Illinois. Broadcasts started in...
How Much Do YouTubers Make?
How Much Do YouTubers Make?
YouTube has evolved from a video-sharing platform into a global hub...
Maleficent. (2014)
A vengeful fairy is driven to curse an infant princess, only to discover that the child may be...
How to rent an apartment - features of finding a tenant and common mistakes of landlords
Renting out an apartment is one of the ways to generate income for property owners. It seems that...
Расёмон. Rashomon. (1950)
Древняя Япония. В лесу изнасилована женщина, а её муж убит. Есть четыре точки зрения на это...