Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
6K
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.
Search
Categories
- Arts
- Business
- Computers
- Games
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
Autism Spectrum: Diagnosis Pt. 2
Ideally the diagnosis of ASD should be given by a team of clinicians (e.g. pediatricians, child...
Метрополис. Metropolis. (1927)
Метрополис - город будущего, разделен на две части. Под землей находятся жилища рабочих, над ними...
Marketing metrics: what metrics are important to track
Marketing metrics: what metrics are important to track
In this article, we will talk...
Лицо со шрамом. Scarface. (1983)
Весной 1980 года был открыт порт Мэйриэл Харбор, и тысячи кубинских беженцев ринулись в...
Serving in Volleyball
Where does volleyball start? With a good mood, with a good game, form or serve? Everyone chooses...