Remove Keys from Dictionary - Python

0
12KB

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. 

Rechercher
Catégories
Lire la suite
Financial Services
Command-and-control regulation
Key points Command-and-control regulation sets specific limits for pollution...
Par Mark Lorenzo 2023-07-21 19:23:46 0 16KB
Agriculture
Fungi
A fungus (pl: fungi or funguses) is any member of the group of eukaryotic organisms that includes...
Par FWhoop Xelqua 2023-04-23 16:48:27 0 16KB
Artificial Life
Exploring Computer Artificial Life: The Intersection of Technology and Biology
Artificial life (ALife) refers to the study and simulation of life-like processes using computer...
Par Dacey Rankins 2024-10-16 16:20:21 0 21KB
Television
WHO TV live stream. Des Moines, Iowa, USA.
WHO-HD Channel 13, is a NBC affiliate TV channel based in Des Moines, Iowa. The channel started...
Par Nikolai Pokryshkin 2022-11-01 07:25:19 0 31KB
Social Issues
It Happened One Night (1934)
A renegade reporter trailing a young runaway heiress for a big story joins her on a bus heading...
Par Leonard Pokrovski 2023-06-28 19:38:38 0 26KB

BigMoney.VIP Powered by Hosting Pokrov