• 1
    Input and Output Data
    • Tasks
  • 2
    Conditions
    • Tasks
  • 3
    For Loop
    • Tasks
  • 4
    Strings
    • Tasks
  • 5
    While Loop
    • Tasks
  • 6
    Lists
    • Tasks
  • 7
    Two-Dimensional Arrays
    • Tasks
  • 8
    Dictionaries
    • Tasks
  • 9
    Sets
    • Tasks
  • 10
    Functions and Recursion
    • Tasks
  • к

Занятие 8. Dictionary

Difficulty level:

Task«Dictionary with goods»

You are the owner of the online store. You need to automate the process of checking the availability of goods in the warehouse before confirming the order. Write a program that accepts information about the current state of the warehouse, the requested product and its quantity, and determines whether it is possible to complete the order.

Input format

first the dictionary is introduced stock , which pre-stringing the warehouse. The dictionary keys are the names of goods (rows), values ​​- the number of units of each product (integers). The dictionary is introduced in the Python format, for example: & nbsp; {'apples': 50, 'bananas': 100, 'orange': 75} rn
merch & nbsp;-the name of the product that wants to buy a client.
Finally, the whole number of n is the number of units of the product that the client wants to buy

Output format

the program should deduce & nbsp; true if the warehouse is enough for the order to execute the order, and & nbsp; false otherwise

Example

Input

{'apples': 50, 'bananas': 100, 'oranges': 75}
apples
25

Output

true

Hint

There will be no clue here, decide for yourself!

main.py
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Developer’s solution

🎉 Congratulations! 🎉

You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.

AD

Advertisement

red-snake blue-snake green-snake

Running your code...

Помощник ИИ

Привет! Я твой помощник по программированию. Задавай любые вопросы по Python, я могу рассказать о функциях, методах, обьяснить то, что тебе не понятно, а так же о текущей задаче!