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
Больше
The Modern Homeowner: Challenges, Opportunities, and Responsibilities
Homeownership is often considered a milestone, a symbol of stability and financial success. For...
A Comprehensive Guide to Airsoft: The Sport, Gear, and Community
Airsoft is an exciting, fast-paced sport that has grown in popularity over the years, attracting...
How Do I Measure the Success of a Business Consulting Engagement?
When hiring a business consultant, companies invest not just in external expertise but in the...
Incredible World Records That Have Been Broken: A Look at the Unbelievable Feats
World records have always fascinated people. They celebrate human achievements that go beyond the...
What Is the Highest-Paying Job in ___ (Country/Industry)?
What Is the Highest-Paying Job in ___ (Country/Industry)?
The answer to “What is the...