Q. 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).


Answer :-


name = input("Enter your name :- ")
age  = int(input ("Enter your age :- "))
if age < 18 :
    print("Your are not eligible to apply for a driving license ")
else :
    print("Your are eligible to apply for a driving license ")


Output :-


Enter your name :- Pathwalla
Enter your age :- 16
Your are not eligible to apply for a driving license
>>> 

Enter your name :- portalexpress
Enter your age :- 21
Your are eligible to apply for a driving license
>>>

3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post