Advertisements
Advertisements
प्रश्न
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).
थोडक्यात उत्तर
Advertisements
उत्तर
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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
