Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

write a program that asks the user for a number. report whether that nu…

Question

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.

Explanation:

Step1: Get user input

num = float(input("Enter a number: "))

Step2: Check conditions

if num > 0:
    print("Positive")
elif num == 0:
    print("Zero")
else:
    print("Negative")

Answer:

num = float(input("Enter a number: "))
if num > 0:
    print("Positive")
elif num == 0:
    print("Zero")
else:
    print("Negative")