For Loops Exercise and Solution 5
Exercise
Exercise 5: Write a program that reads three persons' ages and evaluates if a student is eligible for a driving licence or not.
A person is eligible to get a driving license if he/she is at least 18 years old.
Code
See below the code and output:
for i in range (1,4):
age = float(input("Enter your age: "))
if (age>=18):
print ("You are eligible for a driving license")
else:
print ("You are not eligible for a driving license")
For more details, please contact me here.