Python Dictionary get() Method
Posté 2023-03-07 22:06:39
0
9KB
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
Rechercher
Catégories
- Arts
- Business
- Computers
- Jeux
- Health
- Domicile
- Kids and Teens
- Argent
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Lire la suite
Dyslexia: Neuroimaging
Neuroimaging techniques, such as functional magnetic resonance imaging (fMRI) and positron...
Христианский телеканал GNC
GNC — Первый Христианский спутниковый телеканал на русском и украинском языках,...
Million Dollar Baby. (2004)
A determined woman works with a hardened boxing trainer to become a professional.
My Link
Chakra UI
What is Chakra UI?
Have you ever struggled with whether to focus more on the back-end or...
Прямая трансляция телеканала МУЗ-ТВ
МУЗ-ТВ — культовый музыкальный телеканал, начал свое вещание в 1996 году. С этого момента и...