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
Больше
How Often Should I Review My Financial Plan?
How Often Should I Review My Financial Plan?
How Often Should I Meet with My Adviser, and When...
How Do I Record, Edit, and Publish a Podcast? (Tools, Software, and Workflow)
Introduction: Turning an Idea into a Finished Episode
So, you’ve chosen your podcast...
Quotes from great people
We all patiently count down the last days until spring arrives. But it is better to spend this...
Фестиваль Рифкина. Rifkin's Festival. (2020)
В самом красивом городе на берегу Испании царит романтическое настроение и проходит престижный...
What Equipment Do I Need to Begin a Podcast?
Introduction
Podcasting is one of the most democratic forms of media in existence today. Anyone...