Friday, November 15, 2019

Python program to check if a number is positive, negative or 0.

#Source Code: Using Nested if
num = float(input("Enter a number: "))
if num >= 0:
   if num == 0:
       print("Zero")
   else:
       print("Positive number")
else:
   print("Negative number")


No comments:
Write comments