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
- Деньги
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
What Are Common Mistakes to Avoid When Writing a Business Biography?
Writing a business biography can be a rewarding but challenging task. It requires careful...
Psychic Financial Energy
How Psychic Energy Works to Attract Finances and Improve Material Well-Being
In today’s...
How Do Indie Hackers Fund Their Projects?
In the world of entrepreneurship, indie hackers are individuals who create and grow small,...
Best Practices for Effective Email Marketing in 2023 (and Beyond)
Introduction
Email marketing is one of the most reliable and profitable digital marketing...
Ран. Ran. (1985)
Япония, XVI век. Стареющий правитель Хидэтора объявляет о разделе своих владений между тремя...