Remove Keys from Dictionary - Python
Сообщение 2023-02-23 23:16:41
0
12Кб
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
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
How Do Ads Make Money?
Advertising is one of the largest industries in the world, generating hundreds of billions of...
Benefits of Swimming
Swimming is one of the most popular sports in Australia. Our nation is surrounded by water and...
What Are Fixed vs. Variable Costs?
What Are Fixed vs. Variable Costs?
Understanding costs is one of the most important foundations...
How Often and How Long Should Sessions Be?
When starting a coaching or mentoring relationship, one of the first questions that arises is:...
How Do I Acquire Customers? Strategies and Tactics That Work
Customer acquisition is one of the most common—and most challenging—questions...