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:
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.")
Enter your age:18
You are eligible to vote!
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.”
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.