Pythondex

Exercise

Voting Eligibility Exercise

In this exercise, you’ll create a Python program to check if a person is eligible to vote. You’ll practice using variables, if-else statements, and comparison operators.

Task

Write a Python program that:

  • Asks the user for their age using input()
  • Checks if the age is 18 or above
  • Prints "You are eligible to vote." if True
  • Prints "You are not eligible to vote." if False

Example Output

Or

Solve