Remove Keys from Dictionary - Python

0
9K

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. 

Buscar
Categorías
Read More
Financial Services
Changes in equilibrium price and quantity: the four-step process
Key points There is a four-step process that allows us to predict how an event...
By Mark Lorenzo 2023-02-16 13:07:37 0 18K
История
1917. (2019)
6 апреля 1917 года, разгар Первой мировой войны, Западный фронт на севере Франции. Британский...
By Nikolai Pokryshkin 2023-02-01 22:53:04 0 38K
Business
How much equity should a founder give to investors?
One of the most important decisions a founder will make when raising capital is determining how...
By Dacey Rankins 2025-04-08 14:19:54 0 6K
Programming
Golang vs Java
Golang  Launched in 2011, Go or Golang is an open-source language from Google. Similar...
By Jesse Thomas 2023-07-03 17:15:47 0 10K
Social Issues
Full Metal Jacket. (1987)
A pragmatic U.S. Marine observes the dehumanizing effects the Vietnam War has on his fellow...
By Leonard Pokrovski 2023-01-22 22:24:01 0 19K

BigMoney.VIP Powered by Hosting Pokrov