Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
10KB
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
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
Weather
A weather forecast is a scientifically based assumption about the future state of the weather in...
Why does a start-up business need marketing?
Why does a start-up business need marketing?
It seems that the English-language term...
ADHD: Possible Positive Traits
Possible positive traits of ADHD are a new avenue of research, and therefore limited.
A 2020...
How to Play Battleship
An exciting "battle" will help to brighten up the wait or have fun. We will tell you how to play...
What Is the Scope—And How Will We Measure It?
Determining Boundaries and Success Metrics for the Project**
Project scope defines the...