Python Program to Check if a Number is Positive, Negative or Zero


This content was proof-read by Grammarly. You can Try Grammary for FREE

In this python program, you’l learn how to check for a number of it is a positive , negative or zero. We will be using the conditional statements in python to solve this problem.

How to find if a number is positive, negative or zero?

# Author : Abandantcode.com
# Python Program to Check if a Number is Positive, Negative or Zero
input = 10
if input > 0:
   print("The number that you entered is a Positive number")
elif input == 0:
   print("The number that you entered is Zero")
else:
   print("The number that you entered is a Negative number")

Output


Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book

The number that you entered is a Positive number

A number is considered to be positive if it is greater than zero. In the above program, we have used if elif, else statement in python to check of the value is greater than 0 , less than 0 or equals to 0.

%d bloggers like this: