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 is renewable energy economics?
What Is Renewable Energy Economics?
There is a moment, usually just before dawn, when a wind...
What Is Mentoring?
Mentoring is a powerful and transformative process centered on a longer-term relationship between...
How Is Econometrics Used in Economic Forecasting?
How Is Econometrics Used in Economic Forecasting?
Economic forecasting is a critical tool for...
How to deal with difficult employees?
You know exactly who it is.
Not because they’re loud—though sometimes they are. Not...
What Role Does Data and Market Research Play in Product Strategy?
When it comes to shaping product strategy, there is one ingredient that consistently separates...