Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
5K
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
The World of Entertainment Arts: An Overview of Its Impact and Diversity
The realm of entertainment arts encompasses a broad spectrum of creative disciplines designed to...
Digital marketing
Digital marketing is a way to promote goods and services over the Internet. To find new...
HITTV. Прямой эфир.
HITV — музыкальный телеканал, который создаёт звезд! Мы делаем ставку на новых молодых...
Before Sunrise. (1995)
A young man and woman meet on a train in Europe, and wind up spending one evening together in...
Охота. The Hunt. (2012)
42-летний Лукас живет в небольшой датской деревушке, работает воспитателем в детском саду и...