Positive, Negative Number in Python
Write a Program in Python to check if a Number is Positive, Negative, or Zero
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # We are using the Default function to use if else condition def NumberCheck(a): # This will check that the number is positive or negative if a > 0: print ("The entered Number is Positive") # Checking if the number is negative elif a < 0: print ("The entered Number is Negative") # Else the number is zero else: print("The entered Number is zero") # Taking number from user a = float(input("Please Enter a number: ")) # Printing result NumberCheck(a) |
Output
Please Enter a number: 7
The entered Number is Positive