Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

item 3 10 points eligibility to vote: • the program takes an integer ag…

Question

item 3
10 points
eligibility to vote:

  • the program takes an integer age as input and checks if the person is eligible to vote.
  • it checks if age is greater than or equal to 18.
  • if the condition is met, the function, it indicates that the person is eligible to vote.
  • if the condition is not met, it indicates that the person is not eligible to vote.

printing eligibility message:

  • if the person is eligible to vote, print \you are eligible to vote.\
  • if the person is not eligible to vote, print \you are not eligible to vote.\

sample output 1
enter your age: 15
you are not eligible to vote.
sample output 2
enter your age: 18
you are eligible to vote.
sample output 3

Explanation:

Step1: Get user input

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

Step2: Check eligibility

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

Answer:

age = int(input("Enter your age: "))
if age >= 18:
    print("You are eligible to vote.")
else:
    print("You are not eligible to vote.")