Question: [ Python ] Write an if statement that checks the stock number to determine whether or not the bake shop has enough. If we are

[Python] Write an if statement that checks the stock number to determine whether or not the bake shop has enough. If we are out of stock, print a message that tells the customer there are not enough of that item, and how many we do have left.
Dictionary:
monday_menu ={'choccy chipper': {'price': 2.50, 'stock': 120},
'fudgy pudgy': {'price': 2.50, 'stock': 120},
'key lime crime': {'price': 4.25, 'stock': 96},
'salty sailor': {'price': 4.40, 'stock': 60},
'blueberry blooper': {'price': 5.00, 'stock': 60}}
Variables:
item = input("What would you like to order? ")
quantity = int(input("How many would you like? "))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!