Python Dictionary get() Method
Veröffentlicht 2023-03-07 22:06:39
0
9KB
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
Suche
Kategorien
- Arts
- Business
- Computers
- Spiele
- Health
- Startseite
- Kids and Teens
- Geld
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Mehr lesen
What Is a Minimum Viable Product (MVP)?
A Minimum Viable Product (MVP) is the simplest version of a product that allows a team to collect...
Fun Games to Play with your colleagues
The best games for corporate events: take note and send to colleagues
Corporate parties at work...
String.prototype.match()
A regular expression object, or any object that has a Symbol.match method....
Райя и последний дракон. Raya and the Last Dragon. (2021)
Давным-давно в волшебной стране Кумандре бок о бок с людьми жили драконы — создатели и...
How to write an autobiography
An autobiography is a short story about yourself, which allows you to find out general...