How do I make this work because when I run the code, if I input the amount of money and the cookie that I want, it just displays the result for the chocolate chip one.
money = int(input('How much money did you recieve? '))
cookie = input('What cookie did he/she want? ')
inventory = {
'chocolatechip' : 50,
'oatmeal' : 60,
'butternut' : 65
}
if cookie in inventory:
change = money - inventory['chocolatechip']
if change < 0:
print('Insufficient Cash')
print('Please Try Again')
else:
print(f'Change: {change}')
print("Thank you for buying Mark's Chocolate Chip Cookies")
print('Please Come Again')
elif cookie in inventory:
change = money - inventory['oatmeal']
if change < 0:
print('Insufficient Cash')
print('Please Try Again')
else:
print(f'Change: {change}')
print("Thank You for buying Mark's Oatmeal Cookies")
elif cookie in inventory:
change = money - inventory['butternut']
if change < 0:
print('Insufficient Cash')
print('Please Try Again')
else:
print(f'Change: {change}')
print("Thank You for buying Mark's Butternut Cookies")