Python Dictionary get() Method
Сообщение 2023-03-07 22:06:39
0
12Кб
With the built-in get() method, you can get the value from retrieving the specific key. If you put in a key that doesn't exist in the dictionary, it'll raise a KeyError. Here's an example:
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = car.get("model")
print(x)
>> Mustang
Поиск
Категории
- Arts
- Business
- Computers
- Игры
- Health
- Главная
- Kids and Teens
- Деньги
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
How Does PaaS Work?
The first cloud project I observed looked deceptively simple on a planning board.
The...
ESSENCE AND BASIC CONCEPTS OF MANAGEMENT
The essence of management is to manage everything: production, finances, personnel, resources to...
How Do I Increase My Sales?
Increasing sales is one of the most common goals in business — and also one of the most...
What College Students Need from a Bank
What College Students Need from a Bank
Before picking a specific bank or bank account,...
How to Get High-Quality Leads?
Most businesses do not actually want more leads.
They want fewer wrong ones.
That realization...