Remove Keys from Dictionary - Python
Postado 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.
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
How Can Businesses Handle Ethical Dilemmas?
In today's fast-paced and ever-evolving business world, ethical dilemmas are an inevitable...
The Apartment. (1960)
A Manhattan insurance clerk tries to rise in his company by letting its executives use his...
Changes in equilibrium price and quantity: the four-step process
Key points
There is a four-step process that allows us to predict how an event...
NRG. Music Live TV.
NRG is a modern music TV chanel in Larissa motivated by passion and love for foreign music.NRG's...
The Twilight Saga: New Moon. (2009)
Edward leaves Bella after an attack that nearly claimed her life, and, in her depression, she...