1. Home
  2. Python
  3. Python Examples
  4. Python – Number is Positive, Negative or Zero

Python – Number is Positive, Negative or Zero

Check If Given Number is Positive, Negative or 0

Write a Python program to check if a given number is a positive, negative or 0 number ?

You can use Python’s nested if or if…elif…else statements to check if a given number positive number, negative number of a 0.

Example – Check Using Nested if

Example – Check Using if…elif…else

Here, we have used the if…elif…else statement. We can do the same thing using nested if statements as follows.