Advertisements
Advertisements
Question
Write a program that takes the name and age of the user as input and displays a message about whether the user is eligible to apply for a driving license or not. (the eligible age is 18 years).
Answer in Brief
Advertisements
Solution
Program:
#Program to check the eligibility for driving license
name = input("What is your name? ")
age = int(input("What is your age? "))
#Checking the age and displaying the message accordingly
if age >= 18:
print("You are eligible to apply for the driving license.")
else:
print("You are not eligible to apply for the driving license.")
OUTPUT:
What is your name? John
What is your age? 23
You are eligible to apply for the driving license.shaalaa.com
Is there an error in this question or solution?
