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 Many Credit Cards Should You Have — and How Does a Credit Card Work?
How Many Credit Cards Should You Have — and How Does a Credit Card Work?
Credit cards can...
How Can Solopreneurs Stay Motivated and Productive?
Being a solopreneur comes with a unique set of challenges and rewards. While the freedom to work...
Working Out apps
Most running apps connect to your running watch or fitness tracker for accurate workout data....
17 places in Asia where it is worth visiting at least once in a lifetime
Natural phenomena of incredible beauty and structures erected by people with a century of history...
Where Kids and Teens Can Post Art Online for Free
In today’s digital age, young artists have countless opportunities to showcase their...