Python Dictionary get() Method
Δημοσιευμένα 2023-03-07 22:06:39
0
11χλμ.
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
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Διαβάζω περισσότερα
Baby Money. (2021)
When a home invasion turns into a bloody shoot-out, a pair of ragtag fugitives take refuge in the...
What Is the Work-Life Balance and Flexibility Like?
Work-life balance has become one of the top priorities for employees across industries. As the...
Dyslexia: Associated conditions
Dyslexia often co-occurs with other learning disorders, but the reasons for this comorbidity have...
Data Fabric
Data Fabric
The concept of Data Fabric and the main elements of this concept
It is an...
Can You Keep a Secret? (2019)
Thinking they're about to crash, Emma spills her secrets to a stranger on a plane. At least, she...