Program to check a number is positive, negative or zero

Positive number:- a value of number is greater then zero is known as positive number i.e. 1,2,3,4,etc.

Negative number:- A value of number id lesser then zero is known as negative number i.e. -1,-2,-3,-4,etc.

Program
n = float(input("Enter a number:"))

if n>0:
print("{0" is a positive number", format(n))
elif n==0:
print("{0} is zero", format(n))
else:
print("{0} is negative",format(n))

Leave a Reply