Python Dictionary get() Method
Сообщение 2023-03-07 22:06:39
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
Поиск
Категории
- Arts
- Business
- Computers
- Игры
- Health
- Главная
- Kids and Teens
- Деньги
- News
- Recreation
- Reference
- Regional
- Science
- Shopping
- Society
- Sports
- Бизнес
- Деньги
- Дом
- Досуг
- Здоровье
- Игры
- Искусство
- Источники информации
- Компьютеры
- Наука
- Новости и СМИ
- Общество
- Покупки
- Спорт
- Страны и регионы
- World
Больше
How Do I Register a Business?
Registering a business is a vital step in turning your idea into a legitimate, operating entity....
What Methods Are Used in Inventory Control?
Common: EOQ, ABC Analysis, FIFO/LIFO Pricing, Safety Stock, and Forecasting Tools
Effective...
What role does storytelling play in a business biography?
torytelling is one of the most powerful tools in writing a business biography. A well-crafted...
What are Effective Questions to Ask During Customer Development Interviews?
Customer Development interviews are a critical tool for gathering insights directly from your...
Карты, деньги, два ствола. Lock, Stock and Two Smoking Barrels. (1998)
Четверо молодых парней накопили каждый по 25 тысяч фунтов, чтобы один из них мог сыграть в карты...