This Python program checks if the number(entered by user) is positive, negative or zero.
The user is asked to enter the number, the input number is stored in a variable
number and then we have checked the number using if..elif..else statement.
# User enters the number number = int(input("Enter number: ")) # checking the number if number < 0: print("The entered number is negative.") elif number > 0: print("The entered number is positive.") elif number == 0: print("Number is zero.") else: print("The input is not a number")
- Python program to check Leap Year
- Python program to check if number is prime or not
- Python Program to check even or odd number
- Python Program to add two numbers
- Python program to check if input character is vowel or consonant