Python Dictionary get() Method
نشر بتاريخ 2023-03-07 22:06:39
0
11كيلو بايت
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’s the Difference Between Recruitment and Selection?
Although the terms recruitment and selection are often used interchangeably, they refer to two...
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...
What is the Difference Between a Business Plan and a Business Model?
This question often comes up as people try to clarify the distinction between two critical...
13th (2016)
An in-depth look at the prison system in the United States and how it reveals the nation's...
Definition of AER (Annual Equivalent Rate)
Definition of AER (Annual Equivalent Rate)
The Annual Equivalent Rate (AER) is a standard way of...