Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
12K
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
How Do Cost-of-Living Adjustments (COLA) Work?
How Do Cost-of-Living Adjustments (COLA) Work?
What Is Next Year’s COLA?
Everyone notices...
Dial M for Murder. (1954)
A former tennis star arranges the murder of his adulterous wife.
My Link
Top 15 Questions to Ask About Company Culture
Understanding a company’s culture is crucial when considering a new job, forming a...
Схватка. Heat. (1995)
Нил МакКоли - один из лучших преступников Лос-Анджелеса. Ему противостоит лучший детектив Винсент...
What Is Product-Led Customer Acquisition?
Product-led customer acquisition (PLCA) is a growth strategy where the product itself is the...