Write a Python Program to Check if a Number is Positive, Negative or 0 ?

Python Program to Check if a Number is Positive, Negative or 0 by Nested if

num = float(input("Enter a number: ")) if num >= 0: if num == 0: print("Zero") else: print("Positive number") else: print("Negative number")


Output:

Enter a number: 5 Positive number