Remove Keys from Dictionary - Python

0
12χλμ.

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. 

Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
Television
SMNI News (English) Live TV Philippines
Sonshine Media Network International (SMNI), is the official broadcasting arm of the Kingdom of...
από Nikolai Pokryshkin 2022-08-30 21:56:36 0 36χλμ.
Horror
The Evolution of the Horror Movie Industry: A Tale of Fear, Innovation, and Endurance
The horror movie industry is one of the most enduring and versatile genres in cinema history....
από Dacey Rankins 2024-11-19 15:41:43 0 15χλμ.
Mental Health
Dyslexia: Genetics
Research into potential genetic causes of dyslexia has its roots in post-autopsy examination of...
από Kelsey Rodriguez 2023-06-21 16:25:46 0 12χλμ.
Television
WTNH News 8 Newscasts Live TV. New Haven, Connecticut, USA.
WTNH, channel 8, is an ABC-affiliated television station located in New Haven, Connecticut, USA....
από Nikolai Pokryshkin 2022-11-08 19:34:30 0 31χλμ.
Crafts
Arts and Crafts
Arts & Crafts was an English art movement of the Victorian era (late nineteenth century),...
από FWhoop Xelqua 2023-07-01 19:15:47 0 23χλμ.

BigMoney.VIP Powered by Hosting Pokrov