Computer Science, asked by rajankit70830, 2 months ago

WAP to input age of the user and check whether he is a valid voter or not?

Answers

Answered by bodasaijaladhija1
0

Input age of the person and check whether a person is eligible for voting or not in Python.

This is a simple if else example in the python - Here, we will read the age of the person by using input() function and convert the entered age value to the integer by using int() function. Then we will check the condition, whether age is greater than or equal to 18 or not - if age is greater than or equal to 18, the person will be eligible for the voting.

Program:

# input age

age = int(input("Enter Age : "))

# condition to check voting eligibility

if age>=18:

status="Eligible"

else:

status="Not Eligible"

print("You are ",status," for Vote.")

Similar questions