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
Больше
What Is Monetary Policy?
What Is Monetary Policy?
Monetary policy is one of the most important tools governments use to...
Scizophrenia Negative and Cognitive Symptoms
Negative symptomsNegative symptoms are deficits of normal emotional responses, or of other...
What is Video Marketing? A Strategic Overview for Modern Brands
Introduction
In the era of digital dominance, attention is the most valuable commodity. Amid...
Dear Zachary: A Letter to a Son About His Father (2008)
A filmmaker decides to memorialize a murdered friend when his friend's ex-girlfriend announces...
What Is Retargeting or Remarketing?
Retargeting, also known as remarketing, is one of the most powerful strategies in online...