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.
See this example:
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.