Python Dictionary get() Method
Posted 2023-03-07 22:06:39
0
6KB
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
Search
Nach Verein filtern
- Arts
- Business
- Computers
- Spiele
- Health
- Home
- Kids and Teens
- Money
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Read More
Джанго освобождённый. Django Unchained. (2012)
Шульц — эксцентричный охотник за головами, который выслеживает и отстреливает самых опасных...
Psychosis: Psychoactive Drugs
Various psychoactive substances (both legal and illegal) have been implicated in causing,...
Play by mail
Play by mail games (also known asPBM games,PBEM games or turn-based games) is a gameplayed via...
FOX Weather Live TV USA
Streaming 24/7 from America's Weather Center.Fox Weather is a digital broadcast television...
The Dark Knight. (2008)
When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must...