# Title: Movie program # Author: Varun Merai # Date: 24/06/2025 # Version: Version 1 # Purpose: Asking for the number and the price of tickets and appliying discount if more than 8 tickets bought ticket price should be(a number between $5 and $20) and number of people in the group should be (a number between 1 and 20). print('To use this program you will enter the number of tickets you want to purchase and how much each ticket costs.') print('If you purchase 8 or more tickets, you will receive a 25% discount off the total cost.') print('..lets begin') while True: while True: try: ticket = int(input('How many tickets are you buying? ')) if 1 <= ticket <= 20: break else: print("Number of tickets must be between 1 and 20. Please try again.") except ValueError: print("Invalid input. Please enter a whole number for tickets.") while True: try: price = int(input('What is the ticket price ? ')) if 5 <= price <= 20: break else: print("Ticket price must be between $5 and $20. Please try again.") except ValueError: print("Invalid input. Please enter a whole number for the price.") total_cost_before_discount = ticket * price if ticket >= 8: discount_rate = 0.25 discount_amount = total_cost_before_discount * discount_rate final_price = total_cost_before_discount - discount_amount print(f"You recieved a discount of ${discount_amount}") print(f"The total amount is (${total_cost_before_discount} - ${discount_amount})= {final_price}") else: print("No discount applied.") print(f"The total amount is ${total_cost_before_discount}") while True: again = input("Do you want to calculate for another group? (yes/no) ") if again in ['yes', 'no']: break else: print("Invalid input. Please enter 'yes' or 'no'.") if again == "no": break print("The program has ended.")