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 Are the Advantages of Commerce?
What Are the Advantages of Commerce?
Commerce plays a central role in everyday life. Every time...
Why Pay for Analytics Tools?
In today’s digital economy, businesses of all sizes generate massive amounts of data every...
How Do I Start a Blog? (The Complete Beginner’s Guide)
Starting a blog is one of the most effective ways to build an online presence, share expertise,...
What Tools and Software Do CFOs Use?
What Tools and Software Do CFOs Use?
ERP Systems, FP&A Tools, Dashboards, and Analytics...
Calendar of holidays and sales in the USA: the best offers in online stores that are worth taking advantage of
It seems that promotions and sales last all year round. Especially in the United States. However,...