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. 

Buscar
Categorías
Read More
Antiques
Antiques and Nobility
One of the most interesting definitions of antiques dates back to the end of the XIX century and...
By FWhoop Xelqua 2022-09-27 11:06:24 0 31K
Телевидение
Телеканал «Санкт-Петербург» прямая трансляция.
Смотрите Новости 16+ на телеканале Санкт-Петербург онлайнОперативно и достоверно мы рассказываем...
By Nikolai Pokryshkin 2022-10-03 12:17:31 0 22K
История
Сокровища Сьерра-Мадре. The Treasure of the Sierra Madre. (1948)
В небольшом мексиканском городке Тампико знакомятся два бедняка Доббс и Кертин. От местного...
By Nikolai Pokryshkin 2023-02-19 18:34:14 0 16K
Business
Brand positioning through texts and copywriting
Many outsiders and even business owners consider copywriting very narrowly - exclusively as the...
By Dacey Rankins 2024-09-03 18:36:47 0 9K
Financial Services
Financial Services in the USA: An Overview of a Vital Sector
The financial services industry is one of the most crucial sectors in the United States economy....
By Dacey Rankins 2024-11-08 17:04:14 0 9K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov