Python Program to Check Whether a Number is Positive or Negative or zero
Given a number. The task is to check whether the number is positive or negative or zero.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
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