Check Whether a Number is Positive, Negative, or 0 in Python
(Last Updated On: 12/12/2022)
Python Program to Check Whether a Number is Positive, Negative or 0
# Check Whether a Number is Positive, Negative, or Zero in Python
# accept input from user
num = float(input("Enter any number: "))
# using if condition to verify number type
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")