Remove Keys from Dictionary - Python
Veröffentlicht 2023-02-23 23:16:41
0
9KB
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.
Suche
Kategorien
- Arts
- Business
- Computers
- Spiele
- Health
- Startseite
- Kids and Teens
- Geld
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
Psychosis: Psychoactive Drugs
Various psychoactive substances (both legal and illegal) have been implicated in causing,...
Нефть. There Will Be Blood. (2007)
Начало XX века. Предприниматель Дэниэл Плэйнвью ищет золото и серебро, а находит нефть. За...
Top 10 Greatest Anime
Anime, a wondrous and captivating form of storytelling, has its roots in the land of the rising...
How Does Coaching Differ from Mentoring and Counseling?
Coaching, mentoring, and counseling are all supportive, developmental relationships—but...
Прямая трансляция телеканала МУЗ-ТВ
МУЗ-ТВ — культовый музыкальный телеканал, начал свое вещание в 1996 году. С этого момента и...