Remove Keys from Dictionary - Python
Posted 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.
Căutare
Categorii
- Arts
- Business
- Computers
- Jocuri
- Health
- Home
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Citeste mai mult
ABS, Live TV. Antigua & Barbuda.
The face of local broadcasting in Antigua and Barbuda. ABS TV is an Internet only TV channel...
Business in Agriculture and Forestry: A Growing Sector
Introduction
Agriculture and forestry are vital components of the global economy, providing...
What Strategies Are Best When Marketing on a Tight Budget?
Introduction: Doing More With Less
Marketing budgets are often tight, especially for startups,...
Omega Gospel Live TV. South African Republic.
OMEGA Gospel TV Network is a Christian-based broadcast platform that continuously airs a unique...
What Equipment is Necessary for Remote Work?
As remote work continues to rise in popularity, ensuring that employees have the proper equipment...