Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
7KB
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
Business process
A business process is a set of interrelated tasks and activities aimed at achieving a certain...
What Skills Do Successful Startup Founders Have?
Starting a business and leading a startup is no easy feat. The path to success is often filled...
Tips for Choosing Toys
Toys are needed for the child not only for entertainment, but also for proper development. Now...
Middle East
The Middle East is a region centered in Western Asia.
In Russian-language literature, the term...
Serving in Volleyball
Where does volleyball start? With a good mood, with a good game, form or serve? Everyone chooses...