Remove Keys from Dictionary - Python
Сообщение 2023-02-23 23:16:41
0
6Кб
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.
Поиск
Категории
- Arts
- Business
- Computers
- Игры
- Health
- Главная
- Kids and Teens
- Деньги
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
Business model: what is it and what types are there
Business model: what is it and what types are there
Ensuring...
Autism Spectrum: Possible Causes
It had mostly long been presumed that there is a common cause at the genetic, cognitive, and...
How Do Entrepreneurs Get Funding?
Starting a business requires capital, and many entrepreneurs face the challenge of securing...
Biotechnology: Unlocking the Future of Medicine, Agriculture, and Sustainability
Biotechnology, a field at the intersection of biology and technology, has revolutionized how we...
Top 9 Useful Writing sites
Your creative process as a science fiction writer may be different from that of your peers, but...