subject

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!")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
What does a cascading style sheet resolve a conflict over rules for an element? a. the rule affecting the most content wins b. the rule affecting the most content loses c. the rule with the most specific selector loses d. the rule with the most specific selector wins
Answers: 2
question
Computers and Technology, 22.06.2019 12:30
Which of the choices sean are not true when considering virus behavior
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
You know the right answer?
4.3.7: Positive, Zero, or Negative - Codehs. Question/Test Case:
Write a program that asks th...
Questions
Questions on the website: 13722363