2. Voting Eligibility Check

Acceptance 100% 5 accepted 5 submissions

Easy
No topics listed
No companies listed
Write a Python program that asks the user to enter their age. Then check if the user is eligible to vote or not. A person is eligible to vote only if their age is 18 or above. If the age is 18 or more, print "Eligible to vote". If the age is less than 18, print "Not eligible to vote". The program must take age as input from the user.

Example 1

Input
17
Output
Not eligible to vote

Explanation 17 is less than 18 so the person is not eligible to vote

Example 2

Input
18
Output
Eligible to vote

Explanation 18 is exactly 18 so the person is eligible to vote

Example 3

Input
0
Output
Not eligible to vote

Explanation 0 is less than 18 so the person is not eligible to vote

Acceptance 100%
Accepted 5
Submissions 5
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
Not eligible to vote
No results yet
Run your code to test it against the sample cases.
Problem List