Remove Keys from Dictionary - Python
Postado 2023-02-23 23:16:41
0
6K
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
PUBLIKA Live TV. Телевидение на русском, молдавском и румынском.
Телевидение Молдавии на русском и молдавском языках. Новости, погода, политика, происшествия и...
Python lavalink.py
Lavalink.py is a wrapper for Lavalink which abstracts away most of the code necessary to use...
Marketing metrics: what metrics are important to track
Marketing metrics: what metrics are important to track
In this article, we will talk...
Седьмая Печать. The Seventh Seal. (1957)
В середине XIV века рыцарь Антониус Блок и его оруженосец возвращаются после десяти лет крестовых...
7 Easy Ways to Transfer Files from Android to PC
Sometimes we need to transfer something from a smartphone to a computer. These can be both text...