Python Dictionary get() Method
Postado 2023-03-07 22:06:39
0
12KB
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
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
Judgment at Nuremberg. (1961)
In 1948, an American court in occupied Germany tries four Nazis judged for war crimes.
My Link
Command-and-Control regulation
Key points
Command-and-control regulation sets specific limits for pollution...
Managing Attendee Dynamics: Use Frameworks Like RACI to Clarify Roles and Keep Meetings Small
Meetings are essential for collaboration, but without structure, they can become bloated and...
Problems of working with personnel at enterprises and how to solve them
The success of the company depends on employees. An increasing number of managers are aware of...
The King of Kong: A Fistful of Quarters (2007)
Die-hard gamers compete to break world records on classic arcade games.
My Link