Python Program to Check Types Of Given Number (Zero, Positive & Negative)


This Python programs check whether a given number is Zero, Positive or Negative.


In this program, we first read number from user. After reading, we check type of a given number whether it is Zero, Positive or Negative in Python programming language.

Python Source Code: Types of Number


# Types of Number

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

if number == 0.0:
    print("ZERO")
elif number > 0:
    print("POSITIVE")
else:
    print("NEGATIVE")

Output

Run 1:
-----------------
Enter number: 89
POSITIVE

Run 2:
-----------------
Enter number: 0
ZERO

Run 3:
-----------------
Enter number: -9
NEGATIVE