Python Dictionary get() Method
Postado 2023-03-07 22:06:39
0
12KB
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
Pesquisar
Categorias
- Arts
- Business
- Computers
- Jogos
- Health
- Início
- Kids and Teens
- Money
- News
- Personal Development
- Recreation
- Regional
- Reference
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Личное развитие
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Leia mais
How Can I Secure Additional Funding for Scaling?
Scaling a business is often the most exciting yet challenging stage of entrepreneurship. Unlike...
How Does Personnel Management Support Company Culture?
Company culture is often described as the “personality” of an...
How Do Organizations Measure Knowledge Capital?
In today’s knowledge-driven economy, organizations increasingly recognize that their most...
The Big Lebowski. (1998)
Ultimate L.A. slacker Jeff "The Dude" Lebowski, mistaken for a millionaire of the same name,...
What is flow state and how do I achieve it?
What Is Flow State and How Do I Achieve It?
Flow state is a psychological condition in which a...