Python program to check number is positive or negative by R4R Team

In real life, human are able to judge that the number is positive or negative because of the human intelligance.
like we know that
2 is positive
-3 is negative
0 is neutral

Program-

n=int(input("Enter number to check it is positive or negativen"))
if n>0:
print("Number is positive")
elif n<0:
print("Number is negative")
else:
print("Number is neutral")


Output -

Enter number to check it is positive or negative
3
Number is positive

Enter number to check it is positive or negative
-1
Number is negative

Enter number to check it is positive or negative
0
Number is neutral



In this program, we take number as a input and our task to check to identify it is positive or negative so in first if condition we check number is positive and then in elif we check number is negative or not otherwise it is neutral.
We check for different values and show the output above.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!