Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
11K
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
Телеканал "Продвижение" прямой эфир.
Семейно - развлекательный телеканал «Продвижение» создан в 2014 году. Аудитория...
True Growth Hackers Are Cross-Functional Experts
The phrase “growth hacker” has become popular in modern business, often used to...
Search engine promotion: how it works
Introduction to search engine promotionSearch engine promotion (SEO) is the process of optimizing...
How perfectly competitive firms make output decisions
Key points
As a perfectly competitive firm produces a greater quantity of output,...
The General. (1926)
After being rejected by the Confederate military, not realizing it was due to his crucial...