4.3.7: Positive, Zero, or Negative - Codehs.

Question/Test Case:
Write a program that asks the user for a number. Report whether that number is positive, zero, or negative.

Problem/Error:
File "main.py", line 5
if number < 0:
^
SyntaxError: invalid syntax

My code:
print("Enter a number to see if it's positive, negative, or zero!")

number = int(input("Enter a number: ")

if number < 0:
print(str(number) + "That number is negative!")
elif number > 0:
print(str(number) + "That number is positive!")
else number == 0:
print(str(number) + "That number is zero!")​

Respuesta :

The program is an illustration of the if conditional statement.

Conditional statements are statements whose execution is dependent on its truth value.

The program in Python where comments are used to explain each line is as follows:

#This gets input for the number

number = int(input("Enter a number: "))

#This checks for negative numbers

if number < 0:

   print("Negative!")

#This checks for positive numbers

elif number > 0:

   print("Positive!")

#Otherwise, the number is zero

else:

   print("Zero!")

Read more about similar programs at:

https://brainly.com/question/20475581