Python Dictionary get() Method
نشر بتاريخ 2023-03-07 22:06:39
0
12كيلو بايت
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
إقرأ المزيد
What Challenges Did the CEO Face in Their Career?
Every CEO, no matter how successful, has faced significant challenges on the road to the top....
The best video games of the XXI century
Ranked 10th TOP Bloodborne, released on the PlayStation 4 in 2015, is located. On the...
A Christmas Gift from Bob (2020)
A struggling street musician finds himself the target of an animal welfare investigation that...
How Do I Start Vlogging?
Introduction
Vlogging — or video blogging — has evolved from a casual hobby into a...
49 канал прямая трансляция.
«НСК 49» – новосибирский телеканал. Новости, кино, шоу, музыка –...