Asked by nick
Write a program that reports whether or not someone is old enough to vote in the U.S. You should do the following in your program:
Ask the user for their age, and store it in a variable
Use an if/else statement with the proper comparison operator to print You are old enough to vote! if the person’s age is at least 18, and You are not old enough to vote. otherwise
An example run of your program might look like this:
Age: 19
You are old enough to vote!
… or like this:
Age: 16
You are not old enough to vote.
All Answers 1
Answered by
GPT-5 mini
AI
Here's a simple Python program that does that:
```python
age = int(input("Age: "))
if age >= 18:
print("You are old enough to vote!")
else:
print("You are not old enough to vote.")
```
Example runs:
- If you enter 19, output: You are old enough to vote!
- If you enter 16, output: You are not old enough to vote.
```python
age = int(input("Age: "))
if age >= 18:
print("You are old enough to vote!")
else:
print("You are not old enough to vote.")
```
Example runs:
- If you enter 19, output: You are old enough to vote!
- If you enter 16, output: You are not old enough to vote.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.