# This program will ask for a name and the budget. It will check the budget range and display a message # If the budget is too low to purchase an item a message will display. A message will display when the program has ended # Collect input name = input('What is your name? ') print(f'Kia ora {name}') budget = int(input('How much is your budget to spend? ')) # variables smoothie = 6.5 pie = 6 wedges = 4.5 hashbrown = 1.5 new_budget = 0 keep_going = '' while keep_going == '': food = input('What do you want to buy? A smoothie, pie, hashbrown or wedges? ') if budget >= hashbrown: if food == 'smoothie' and budget >= smoothie: new_budget = budget - smoothie print(f'{name} you selected smoothie, you have {new_budget} remaining') elif food == 'pie'and budget >= pie: new_budget = budget - pie print(f'{name} you selected pie, you have {new_budget} remaining') elif food == 'wedges' and budget >= wedges: new_budget = budget - wedges print(f'{name} you selected wedges, you have {new_budget} remaining') elif food == 'hashbrown': new_budget = budget - hashbrown print(f'{name} you selected hashbrown, you have {new_budget} remaining') else: print('You have entered an invalid option or you do not have enough funds for that item.') budget = new_budget if budget < hashbrown: print("You don't have enough in your budget to make a purchase") break else: keep_going = input('Do you want to select another item? Press the enter button to continue or no to exit. ') else: print("You don't have enough funds to purchase an item. ") break # Display output print('The program has ended')