create a program to check if a number input by the user is positive or a negative number
Answers
Answered by
0
Answer:
In this python program, user enters a number and checked if the number is positive or negative or zero.
num = float(input("Enter a number: "))
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")
Explanation:
1.In this python program, user enters a number and 2.checked if the number is positive or negative or 3.zero.
4.num = float(input("Enter a number: "))
4.if num > 0:
5.print("Positive number")
6.elif num == 0:
7.print("Zero")
8.else:
9.print("Negative number")
Similar questions