Python Dictionary get() Method
Postado 2023-03-07 22:06:39
0
11KB
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
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
The Shawshank Redemption. (1994)
Chronicles the experiences of a formerly successful banker as a prisoner in the gloomy jailhouse...
KFSM - 5 News Live TV. Arkansas, USA.
KFSM-TV is the CBS-affiliated television station for the Arkansas River Valley and Northwest...
Global and local trends in the fintech sector
The first half of 2024 turned out to be challenging for the financial technology (fintech) market...
Happiest Countries in the World
Since 2002, the World Happiness Report has used statistical analysis to determine the world's...
Art in different forms
"Art is one of the most general categories of aesthetics, art history and artistic practice....