# How to Check a Number is Negative, Positive or 0 in Python

In this tutorial, we will look at some of the different ways of determining whether a number is positive, negative or zero in Python.

## The if elif else Solution

First, we check if the number is greater than 0, if `True` it must be positive, then we check if it is equal to zero, else the number must be negative.

``````num = -1
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")
``````
``````Negative number
``````

## Nested if Statement Solution

Another way to approach this is with a nested if statement.

``````num = -1
if num >= 0:
if num == 0:
print("Zero")
else:
print("Positive number")
else:
print("Negative number")
``````
``````Negative number
``````

May 05, 2022

### How to Use Argparse in Python

September 25, 2020

June 04, 2021

October 15, 2020

### How to use slice() & substring() to Get Parts of a String in JavaScript

September 12, 2020

### How to Get Substring from String in PHP

December 09, 2020