Remove Keys from Dictionary - Python

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
Mehr lesen
Mental Health
Psychosis: Psychoactive Drugs
Various psychoactive substances (both legal and illegal) have been implicated in causing,...
Von Kelsey Rodriguez 2023-05-29 18:19:02 0 10KB
Социальные проблемы
Нефть. There Will Be Blood. (2007)
Начало XX века. Предприниматель Дэниэл Плэйнвью ищет золото и серебро, а находит нефть. За...
Von Nikolai Pokryshkin 2023-02-12 14:33:15 0 19KB
Animation
Top 10 Greatest Anime
Anime, a wondrous and captivating form of storytelling, has its roots in the land of the rising...
Von FWhoop Xelqua 2023-04-27 17:44:48 0 16KB
Business
How Does Coaching Differ from Mentoring and Counseling?
Coaching, mentoring, and counseling are all supportive, developmental relationships—but...
Von Dacey Rankins 2025-07-21 05:34:42 0 1KB
Телевидение
Прямая трансляция телеканала МУЗ-ТВ
МУЗ-ТВ — культовый музыкальный телеканал, начал свое вещание в 1996 году. С этого момента и...
Von Nikolai Pokryshkin 2022-10-05 08:36:37 0 28KB

BigMoney.VIP Powered by Hosting Pokrov