Python program to take a number as input and tells its positive or negative
Following program shows you how to take a number as input and tells its positive or negative.
In this program we get number from user, and if the number is less than zero it prints negative, and if the number is grater than zero it prints positive
number = int(input("Please enter a number:: "))
if (number < 0):
print("Given number is -ve")
else:
print("Given number is +ve")
Output:
Example1:
Please enter a number: 7
Given number is +ve
Example2:
Please enter a number: -7
Given number is -ve