Hello everyone, welcome to nkcoderz.com. In this article we will going to discuss about Python program to print eligibility to vote.
Certainly! Here is a Python program that will determine whether a person is eligible to vote based on their age:
Program to print eligibility to vote In C
Table of Contents
Code For python program to print eligibility to vote
# Get the user's age
age = int(input("Enter your age: "))
# Determine whether the user is eligible to vote
if age >= 18:
print("You are eligible to vote!")
else:
print("You are not yet eligible to vote.")
Output
Enter your age:
18
You are eligible to vote!
Explanation
This program first gets the user’s age by prompting the user to enter their age and then converting the entered age to an integer. It then checks if the age is greater than or equal to 18. If it is, the program prints “You are eligible to vote!”. If the age is less than 18, the program prints “You are not yet eligible to vote.”
Python program to print the number of days in a month using switch statements
Conclusion
If you liked this post ‘Python program to print eligibility to vote‘, then please share this with your friends and make sure to bookmark this website for more awesome content.