Remove Keys from Dictionary - Python
نشر بتاريخ منذ ٢ سنوات
0
6كيلو بايت
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
إقرأ المزيد
Python Assert
The assert keyword is used when debugging code.
The assert keyword lets you...
The Croods: A New Age (2020)
The prehistoric family the Croods are challenged by a rival family the Bettermans, who claim to...
JSON Object Literals
JSON object literals are surrounded by curly braces {}. JSON object literals...
Рождество кота Боба. A Christmas Gift from Bob. (2020)
До встречи с котом Бобом Джеймс не любил Рождество, но рыжий пушистый хулиган всё изменил. Он в...
Расёмон. Rashomon. (1950)
Древняя Япония. В лесу изнасилована женщина, а её муж убит. Есть четыре точки зрения на это...