Positive or Negative number in Python

Share on facebook
Share on twitter
Share on linkedin
Share on twitter
Share on tumblr

In this In this Basic Python Program, we will have a look at “How to find if a given number is positive, negative or zero”

Python Program To Find Positive or Negative number in Python

num = float(input("Enter a number: "))
if num > 0:
   print("Positive number")
elif num == 0:
   print("Zero")
else:
   print("Negative number")

Output:

Enter a number: 2
Positive number


Leave a Comment

Your email address will not be published. Required fields are marked *