Python | Program to Check if Number is Positive/Negative

In any programming language, for dealing with Data you need to check if some number variable is positive or negative.
In this article, I’ll discuss Python Code for Checking if Number is Positive/Negative.

Python Code for Checking if Number is Positive/Negative

# Python Program to Check if Number is positive/negative

num = float(input("Enter the number => "))

# Checks if Number is positive/negative
if (num > 0):
	print(num, "is positive")
else:
	print(num, "is negative")

Output of Above Code

Enter the number => 72
72.0 is positive

Gagan

Hi, there I'm founder of ComputerScienceHub(Started this to bring useful Computer Science information just at one place). Personally I've been doing JavaScript, Python development since 2015(Been long) - Worked upon couple of Web Development Projects, Did some Data Science stuff using Python. Nowadays primarily I work as Freelance JavaScript Developer(Web Developer) and on side-by-side managing team of Computer Science specialists at ComputerScienceHub.io

Leave a Reply

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

Recent Posts