Remove Keys from Dictionary - Python
نشر بتاريخ 2023-02-23 23:16:41
0
9كيلو بايت
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
إقرأ المزيد
Чужой. Alien. (1979)
В далеком будущем возвращающийся на Землю грузовой космический корабль перехватывает исходящий с...
What is the Lean Startup Methodology?
In the fast-paced world of entrepreneurship, the Lean Startup methodology has become a...
The Art of Recreation: Finding the Fun in the Funny
In a world often shrouded in seriousness, where responsibilities weigh heavy and challenges lurk...
Телеканал Бьюти.TV. Прямой эфир.
Бьюти.TV это телеканал про красоту, актуальные тренды и стильные решения в образах. Легкие...
Video Game Publisher
A computer game publisher is a company that publishes computer games developed internally or by...