Skip to main content

Program To Read Person's Age From Keyboard And Display Whether Is Eligible For Voting Or Not

· One min read
Kaustubh Kulkarni
file.py
# Write a program to read person's age from keyboard and display whether is eligible for voting or not
def isEligible(age):
if age>18:
print("Eligible for voting")
else:
print("Not eligible for voting")
isEligible(int(input("Enter Age : ")))
file.py
Output:
Enter Age : 19
Eligible for voting
Enter Age : 13
Not eligible for voting