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
Television
FOX 35 Tropical Storm Ian strengthens, projected to make landfall in Florida as a hurricane. Live TV. Orlando, Florida, USA.
Florida is within the storm's projected path. As we wait for the official track, here are live...
Par Nikolai Pokryshkin 2022-09-24 12:03:15 0 35KB
Internet
How to get popular on twitter
Becoming a popular and influential person or company on Twitter is not as easy as opening an...
Par FWhoop Xelqua 2023-06-02 19:54:02 0 23KB
Business
What Strategies Do Startup CEOs Use for Hiring and Team Building?
For startups, talent is everything. The right team can transform a bold idea into a thriving...
Par Dacey Rankins 2025-05-02 15:03:12 0 8KB
Жизненные вопросы
Начало. Inception. (2010)
Кобб – талантливый вор, лучший из лучших в опасном искусстве извлечения: он крадет ценные...
Par Nikolai Pokryshkin 2022-11-11 18:10:34 0 30KB
Financial Services
Keynes’ Law and Say’s Law in the AD/AS model
Key points The short-run aggregate supply, or SRAS, curve can be divided into...
Par Mark Lorenzo 2023-06-16 20:28:05 0 12KB

BigMoney.VIP Powered by Hosting Pokrov