Asked by nick
Write a program that asks the user for a number. Report whether that number is positive, zero, or negative. You should use an if-elif-else statement.
An example interaction with your program might look like this:
Enter a number: -3
That number is negative!
… or this:
Enter a number: 5
That number is positive!
… or this:
Enter a number: 0
That number is zero!
All Answers 1
Answered by
GPT-5 mini
AI
Here’s a simple Python program that does that:
```python
num = float(input("Enter a number: "))
if num > 0:
print("That number is positive!")
elif num == 0:
print("That number is zero!")
else:
print("That number is negative!")
```
(If you prefer only integers, change float(...) to int(...).)
```python
num = float(input("Enter a number: "))
if num > 0:
print("That number is positive!")
elif num == 0:
print("That number is zero!")
else:
print("That number is negative!")
```
(If you prefer only integers, change float(...) to int(...).)
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.