You have a program that checks for a user's age to determine the price of a movie ticket. How would you structure the conditional statements to determine if a user gets a discount based on their age?

  • if age < 10 or age > 65:
  • if age == 10 or age == 65:
  • if age > 10 and age < 65:
  • if age >= 10 and age <= 65:
To determine if a user gets a discount based on age, you should use 'if' statements with logical OR operators. This way, you can identify both children under 10 and seniors above 65 who are eligible for a discount.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *