Given a number. The task is to check whether the number is positive or negative or zero.
Input: 5 Output: Positive Input: -5 Output: Negative
We will use the if-elif statements in Python. We will check whether the number is greater than zero or smaller than zero or equal to zero.
Below is the implementation.
Positive Equal to zero Negative
- Program to check if a number is Positive, Negative, Odd, Even, Zero
- Python program to count positive and negative numbers in a list
- Python | Replace negative value with zero in numpy array
- Lambda expression in Python to rearrange positive and negative numbers
- Python | Counting sign change in list containing Positive and Negative Integers
- Python | Rearrange Positive and Negative Elements
- Python | Segregate Positive and Negative Integers from mixed string
- How to check whether the elements of a given NumPy array is non-zero?
- Highlight the negative values red and positive values black in Pandas Dataframe
- Test whether the elements of a given NumPy array is zero or not in Python
- Python Program to check whether it is possible to make a divisible by 3 number using all digits in an array
- Python program to check whether a number is Prime or not
- Python Program to Convert any Positive Real Number to Binary string
- Python | Check if all values in numpy are zero
- Python program to create a list centered on zero
- Python program to print all negative numbers in a range
- Python program to print negative numbers in a list
- Python program to check whether the string is Symmetrical or Palindrome
- Python program to check whether the values of a dictionary are in same order as in a list
- Python program to print positive numbers in a list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.