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
Business and Corporate Finance
Why Is Business Finance Important?
Why Is Business Finance Important? Business finance is the backbone of every successful...
Par Leonard Pokrovski 2025-12-27 22:36:32 0 4KB
Social Issues
Gone Girl. (2014)
With his wife's disappearance having become the focus of an intense media circus, a man sees the...
Par Leonard Pokrovski 2023-03-26 15:43:39 0 30KB
Business
How Do I Follow Up Without Being Annoying?
Following up is one of the most important skills in sales — and also one of the most...
Par Dacey Rankins 2025-12-15 17:47:51 0 2KB
Научная фантастика и фэнтези
Индиана Джонс: В поисках утраченного ковчега. Indiana Jones and the Raiders of the Lost Ark. (1981)
Известный археолог и специалист по оккультным наукам доктор Джонс получает опасное задание от...
Par Nikolai Pokryshkin 2022-12-13 18:09:48 0 28KB
Coin-Op
Arcade machines: a little history of development
Now gamers, without leaving home or even looking up from their mobile device, can start computer...
Par Michael Pokrovski 2024-04-03 21:08:20 0 22KB

BigMoney.VIP Powered by Hosting Pokrov