Python program to How to find given number is Positive or Negative

In this python example we will write code to find the given number is Even or odd number

  • User will enter the number
  • Read the user number into variable x
  • Check if the given number is greater than 0 print given number is Possitive
  • Check if the given number is less than 0 print given number is Negative
x = float(input("Insert any number: "))
if x>0:
 print("This is a POSITIVE number")
elif x < 0:
 print("This is a NEGATIVE number")
else:
 print("The number is ZERO")

 

Output:

Insert any number: 121
This is a POSITIVE number

 

Insert any number: -121
This is a NEGATIVE number

 

 

Subscribe For Daily Updates