Check if a Number is Positive, Negative or 0 Program in Python

Check if a Number is Positive, Negative or 0 Program in Python



Code:

number = int(input("enter number : "))

if (number == 0):

    print(number , "is 0")

elif(number > 0 ):

    print(number , "is positive")

else:

    print(number , "is negative")





Output:


enter number : -10
-10 is negative
>>> 

Video Tutorial:






Post a Comment

Previous Post Next Post