Write a program that keeps track of a simple inventory for a store. While there are still items left in the inventory, ask the user how many items they would like to buy. Then print out how many are left in inventory after the purchase. You should use a while loop for this problem. A sample run is below.

We have 20 items in inventory.
How many would you like to buy? 4
Now we have 16 left.
We have 16 items in inventory.
How many would you like to buy? 2
Now we have 14 left.
We have 14 items in inventory.
How many would you like to buy? 8
Now we have 6 left.
We have 6 items in inventory.
How many would you like to buy? 5
Now we have 1 left.
We have 1 items in inventory.
How many would you like to buy? 1
All out!
Make sure you catch the case where the user tries to buy more items than there are in the inventory. In that case, you should print a message to the user saying that their request isn’t possible. For example:
We have 5 items in inventory.
How many would you like to buy? 6
There is not enough in inventory for that purchase.
We have 5 items in inventory.
How many would you like to buy? 5
All out!

inventory = 20

while inventory > 0:
print("We have", inventory, "items in inventory.")
purchase = int(input("How many would you like to buy? "))
if purchase > inventory:
print("There is not enough in inventory for that purchase.")
else:
inventory -= purchase
if inventory == 0:
print("All out!")
else:
print("Now we have", inventory, "left.")

i am losing my mind. not sure if you can see my replies "Anonymous", but this is insane. i'm going to go outside and think about how insane this is. good lucky with your job or your assignment or whatever you're working on