cs/practical-file/answers/question_15.py

7 lines
252 B
Python

# Question: Write a Python program to accept age and check whether the person is eligible to vote (18 or older).
age = int(input("Enter your age: "))
if age >= 18:
print("You are eligible to vote.")
else:
print("You are not eligible to vote.")