Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
13K
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.
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia Mais
How to earn money through illustration
What will you need to make money on drawings on the Internet?
Before you learn how to make money...
What is monopoly and oligopoly?
Monopoly and Oligopoly: Power, Strategy, and the Architecture of Markets
I once sat in a...
What to do if you have a mobile app idea: a beginner's guide.
What to do if you have a mobile app idea: a beginner's guide.
One fine morning, you wake up with...
What is a career in economic development?
A career in economic development sits at the intersection of policy, business, and community...
Thirteen. (2003)
A thirteen-year-old girl's relationship with her mother is put to the test as she discovers...