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

In this example, we will write a simple program to take input number from the user and display if it is either positive, negative or zero. To better understand this example, make sure you have knowledge of the following tutorials:-

Source code using  if…elif…else statement to check if a number is positive or negative or zero:

The output of the above program is:-

Enter the value of a: 0
The number is zero

Source code for Python nested statement to check if a number is positive or negative or zero:

The output of the above program is:-

Enter the value of a: 4
The number is positive
SHARE Python Program to Check if a Number is Positive, Negative or Zero

You may also like...

Leave a Reply

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

Share