Remove Keys from Dictionary - Python
Posted 2023-02-23 23:16:41
0
6KB
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.
Search
Nach Verein filtern
- Arts
- Business
- Computers
- Spiele
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
Measuring the size of the economy: gross domestic product
Key points
The size of a nation’s economy is...
Work From Home – Tips to Help You Stay Productive
Based on my experience, I've put together 15 tips for working from home to help you stay...
Home Gardening
Home gardening can be a rewarding and therapeutic activity, and choosing the right plants is key...
How to make a budget for yourself
What will you learn?
What is budgeting?
What budgeting...
FOX 6 Live TV. Milwaukee USA.
Milwaukee news, weather, traffic and sports from FOX6, serving southeast Wisconsin. Get breaking...