Program to check whether a person eligible to vote

In this python if else program, we will check whether a person is eligible to vote or not depending on his/her age.

Condition for eligibility:
If the age of a person is greater than 18 then the person is eligible otherwise not.

Steps to solve the program
  1. Take the age of the person as input through the user.
  2. If the age is greater than or equal to 18 then the person is eligible to vote, else the person is not eligible to vote.
  3. Use if-else statement for this purpose.
  4. Print the respective output.
				
					age = int(input("Enter age: "))

if age >= 18:
    print("You are eligible")
else:
    print("You are not eligible")
				
			

Output :

				
					Enter age: 20
You are eligible
				
			

Related Articles

find the largest number among three numbers.

check whether any given number is a palindrome.

Leave a Comment