Python Program to Check Whether a Number is Positive or Negative

Problem: Write a python program to check if given number is positive negative or zero.

Solution: This python program accepts a number from user and check whether the number is postive, negative or zero. Relation operator is used to check positivity or negativity. If a number is greater than 0 is it positive, if a number is less than zero it is negative. If it neither positive nor negative it is zero.

Python program to check whether a number is positive or negative

num=int(input("Enter any number: "))
if(num>0):
    print("Number is positive")
else:
    print("Number is negative")

Output:

Enter any number: 75
Number is positive