 ## check if a Number is Positive, Negative or Zero using python

In this blog post “we can check a number is positive, negative or zero using python program”.

In this program we will check whether the given number is positive or negative or zero entered by user.

We will solve this program by using if-elseif-else, elif statement and nested-if statement of python.

positive Number : –

If a number is grater than zero then it is a positive number.

We get positive numbers higher further we move towards right.

For ex:- 1,3,6.,10, etc.

Negative Number : –

If a number is smaller than zero then it is Negative number.

Negative number have minus ( – ) sign in front of them.

We get positive numbers lower further we move towards left.

For ex:- -11,-2,-8,-1, etc.

Zero:-

zero is neither Positive nor Negative.

For solving this example we need knowledge about :

• Python if-elseif-else Statement
• Nested if in python

program using if-elseif-else : –

x = float(input(“Enter a number: “))

if x > 0:

print(“Number is Positive”)

elif x == 0:

print(“Zero”)

else:

print(“Number is Negative”)

output : – program using Nested-if : –

y = float(input(“Enter a number: “))

if y >= 0:

if y == 0:

print(“Zero”)

else:

print(“No is Positive”)

else:

print(“No is Negative”)

output : – Best 5 Python Framework in 2020

Python with MySQL

file handling in python 3

Python list

Python Tuple

10 Best Web Scraping Tool in 2020

#### Harsh

Hey Friends, Welcome to thetechbuddy. This blog is about technical or programming knowledge.