CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Write a program that takes the name and age of the user as input and displays a message whether the user is eligible to apply for a driving license or not. (the eligible age is 18 years).

Open in App
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.

flag
Suggest Corrections
thumbs-up
21
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Getting a Driving Licence
CIVICS
Watch in App
Join BYJU'S Learning Program
CrossIcon