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
Micro vs Macro vs Mega Influencers: What’s the Difference and When Should You Use Each?
Introduction: The Changing Face of Influence
Influencer marketing has transformed from a fringe...
How to analyze info
How to learn how to analyze information?
The modern world is filled with...
The Concept of Desktop Publishing
The concept of computer publishing systems appeared in connection with the development of...
How Do I Target the Right Audience on Facebook?
Audience targeting is one of the most powerful—and most misunderstood—parts of...
How Do I Create a Facebook Ad?
Creating a Facebook ad is not just about designing a visual and pressing “publish.”...