Python program to How to find given number is Positive or 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")
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
Output:
|
Insert any number: 121 |
|
Insert any number: -121 |