Remove Keys from Dictionary - Python

0
7K

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
Citeste mai mult
Business
5 reasons to work if you already have enough money
Many work primarily for money.But this is not everyone's only motivation. Many people advise...
By Dacey Rankins 2024-09-24 13:46:25 0 12K
Телевидение
Прямая трансляция Омск ТВ.
Прямая трансляция Омск и архивные онлайн эфиры. Моя ссылка
By Nikolai Pokryshkin 2022-10-09 12:45:55 0 20K
Virtual Reality
The Death of Virtual Reality: What VR Technologies Have in Store for the Home
Three-dimensional bummer Seven years. That's how long it has been since the incredible success...
By Dacey Rankins 2024-04-01 17:47:50 0 11K
Mental Health
Psychosocial interventions
A number of psychosocial interventions that include several types of psychotherapy may be useful...
By Kelsey Rodriguez 2023-02-08 18:05:20 0 7K
Телевидение
Христианский телеканал GNC
GNC — Первый Христианский спутниковый телеканал на русском и украинском языках,...
By Nikolai Pokryshkin 2022-08-30 10:47:57 0 22K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov