In this python if else program we will, check the eligibility of a person to sit on a roller coaster ride according to his/her age.
Codition for eligibility:
Age is greater than 12 then only person is eligible.
Steps to solve the program
- Take age as input through the user.
- Using an if-else statement check the eligibility of a person.
- If the age is greater than or equal to 12 only then is the person eligible.
- Print the respective output.
age = int(input("Enter the age of a person: "))
if age >= 12:
print("You are eligible")
else:
print("You are not eligible");
Output :
Enter the age of a person: 15
You are eligible