Positive or Negative number in Python

Share on facebook
Share on twitter
Share on pinterest

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


Subscribe to our Newsletter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Share this post with your friends

Share on facebook
Share on google
Share on twitter
Share on linkedin

Leave a Reply

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