Remove Keys from Dictionary - Python
Сообщение 2023-02-23 23:16:41
0
10Кб
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
Больше
Embracing Adventure: The Magic of Recreational Camping
Embracing Adventure: The Magic of Recreational Camping
Introduction: Amidst the hustle and...
Happiest Countries in the World
Since 2002, the World Happiness Report has used statistical analysis to determine the world's...
What Is Competitive Advantage in Business Strategy?
In today’s fast-paced and competitive business world, the ability to outperform competitors...
Music genres
There are only four musical directions: folk music, sacred music, academic music and popular...
Unveiling the Timeless Appeal of Antiques and Collectibles
In today's fast-paced world where technology evolves at the blink of an eye, there's a certain...