Python Dictionary get() Method

0
9كيلو بايت

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
البحث
الأقسام
إقرأ المزيد
Business
Infrastructure as a Service (IaaS): Virtual Infrastructure Delivery
Infrastructure as a Service (IaaS) is a cloud service model that allows you to rent virtual...
بواسطة Dacey Rankins 2024-09-25 17:33:58 0 21كيلو بايت
Social Issues
Man on Wire (2008)
A look at tightrope walker Philippe Petit's daring, but illegal, high-wire routine performed...
بواسطة Leonard Pokrovski 2023-07-30 20:26:32 0 519كيلو بايت
Социальные проблемы
История Игрушек. Большой побег. Toy Story 3. (2010)
Энди почти 18 лет, ему остаётся 3 дня до отправки в колледж, в то время как его игрушки, в том...
بواسطة Nikolai Pokryshkin 2023-01-08 18:24:06 0 23كيلو بايت
Социальные проблемы
Земля кочевников. Nomadland. (2020)
После закрытия завода по производству гипсокартона в январе 2011 года 60-летняя женщина Ферн...
بواسطة Nikolai Pokryshkin 2022-10-05 13:04:32 0 26كيلو بايت
Gardening
The Joy of Home Gardening: Cultivating Your Green Thumb
Home gardening has gained immense popularity in recent years, and for good reason. Whether you...
بواسطة Dacey Rankins 2024-10-09 17:39:16 0 15كيلو بايت
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov