Here is my code to check is the number is positive, negative or zero.
x = input("Enter a number to check if it is positive, negative or zero.")
def function():
if x == 0:
print("The number is zero.")
elif x > 0:
print("The number is positive.")
elif x < 0:
print("The number is negative.")
Here is the error I get
File "<string>", line 4
print("The number is zero.")
^
IndentationError: expected an indented block
>
Aucun commentaire:
Enregistrer un commentaire