Output for the following input: a positive number, a negative number, and zero.
An explanation of your choice for what to call for input of zero.
1
Expert's answer
2021-12-06T02:16:40-0500
# This time use nested if to solve the problem
num = float(input("Enter a number: "))
if num >= 0:
if num == 0:
print("Zero")
else:
print("Positive number")
else:
print("Negative number")
Comments
Leave a comment