Programming Examples

Python program to check number is positive negative or zero


write a program to print one of the words negative, zero or positive, according to whether variable x is less than zero, zero, or greater than zero, respectively.

Solution

x=int(input("Enter any Integer Number : "))
if x==0:
    print("Number is Zero")
elif x>0:
    print("It is Positive Number")
else:
    print("It is Negative Number")
Output

Enter any Integer Number : 4

It is Positive Number

>>> 

======================== R

Enter any Integer Number : -9

It is Negative Number

>>> 

======================== 

Enter any Integer Number : 0

Number is Zero

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz