Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
9K
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
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia Mais
49 канал прямая трансляция.
«НСК 49» – новосибирский телеканал. Новости, кино, шоу, музыка –...
What Skills Are Essential for a CEO?
Being a Chief Executive Officer (CEO) requires more than just experience — it demands a...
Капоне. Лицо со шрамом. Capone. (2020)
Вернувшись из тюрьмы, Аль Капоне продолжает оставаться предметом пристального внимания ФБР. Ведь...
JavaScript set()
In JavaScript, a setter can be used to execute a function whenever a specified property is...
How Long Does a Business Consulting Project Usually Take?
Business consulting is a key element in helping organizations improve performance, solve...