Python Dictionary get() Method
Сообщение 2023-03-07 22:06:39
0
4Кб
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
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
Exploring the Vital Role of Publications: A Gateway to Knowledge
Exploring the Vital Role of Publications: A Gateway to Knowledge
In the realm of academia,...
How to use neural networks to write a script for TikTok, Reels and Shorts
In 2023, neural networks continue to be one of the most actively developing areas. In recent...
Опасный пациент. The Shift. (2021)
Возвращаясь после ночной смены, врачи скорой помощи Изабель и Адамо получают срочный вызов. В...
Film Awards
Oscar Academy Awards, OscarLos Angeles, California, USA
Golden Globes
Los Angeles, California,...
Scizophrenia Onset
OnsetOnset typically occurs between the late teens and early 30s, with the peak incidence...