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 the Difference Between Boosting a Post and Running a Facebook Ad?
One of the most confusing parts of Facebook advertising—especially for beginners and small...
Toy Story. (1995)
A cowboy doll is profoundly threatened and jealous when a new spaceman action figure supplants...
Первый канал. Прямой эфир
Ежедневно в эфире Первого лучшие развлекательные шоу, уникальные документальные передачи, свежие...
Which Finance Biography Books Are More Suitable for Beginners vs. More Advanced Readers?
Which Finance Biography Books Are More Suitable for Beginners vs. More Advanced Readers?
Finance...
Dyslexia: Pathophysiology
For most people who are right-hand dominant, the left hemisphere of their brain is more...