Python program to check if a number is positive negative or zero

Python program to check if a number is positive negative or zero

Python program to check if a number is positive negative or zero
In this example we will learn How to check wether a number is positive negative or zero

for this we will use if-elif-else statements.

n= int( input( ‘ Enter any number ‘ ))
if ( n > 0)
    print( ‘ Number is Positive ‘)
elif ( n==0 )
    print( ‘ Zero number’ )
else
    print(‘ Number is Negative’) 

Output

Enter any number : 15
Number is positive
Again run the program
Enter any number : 0
Zero Number
Again run the program
Enter any number : -5
Number is Negative

If you like my post please share it with your friends by simply clicking the below social media button, and Don’t forget to comment so we will update ourselves.

Share in a Single Click

Leave a Reply

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