Javatpoint Logo
Javatpoint Logo

Python Program to check if a Number is Positive, Negative or Zero

We can use a Python program to distinguish that if a number is positive, negative or zero.

Positive Numbers: A number is known as a positive number if it has a greater value than zero. i.e. 1, 2, 3, 4 etc.

Negative Numbers: A number is known as a negative number if it has a lesser value than zero. i.e. -1, -2, -3, -4 etc.

Python Condition And Loops1

See this example:


Python Condition And Loops2

Note:In the above example, elif statement is used. The elif statement is used to check multiple expressions for TRUE and executes a block of code when one of the conditions becomes TRUE.

It is always followed by if statement.

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA