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
Больше
Colombiana. (2011)
A young girl in Bogotá witnesses her parents' murder and grows up to be a stone-cold...
Real Estate: A Comprehensive Overview
Real estate is a dynamic sector that plays a crucial role in the economy, providing not only...
Inside Job. (2010)
'Inside Job' provides a comprehensive analysis of the global financial crisis of 2008, which at a...
История Игрушек. Большой побег. Toy Story 3. (2010)
Энди почти 18 лет, ему остаётся 3 дня до отправки в колледж, в то время как его игрушки, в том...
In Secret. (2013)
Thérèse grows up with her aunt and cousin. Around 1860 the aunt decides they move...