Remove Keys from Dictionary - Python
Сообщение 2023-02-23 23:16:41
0
13Кб
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.
Поиск
Категории
- Arts
- Business
- Computers
- Игры
- Health
- Главная
- Kids and Teens
- Деньги
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
What are tariffs?
What Are Tariffs? The Tax That Quietly Shapes Global Trade
A tariff is, at its simplest, a tax...
The Green Mile. (1999)
The lives of guards on Death Row are affected by one of their charges: a black man accused of...
How Much Will I Get from Social Security?
How Much Will I Get from Social Security?
Social Security is a critical part of retirement...
What Universal Concerns Exist Around Growth?
Growth is a concept that stretches across every level of existence—from the individual to...
How Do I Advertise on a Billboard?
Billboard advertising is one of the most visible forms of outdoor advertising, but for many...