Can anyone look at my code to create a function which takes two numbers and tells which one is positive and which one is negative? My code is getting stuck at first if statement. The error I get is invalid syntax.
FirstInteger = input(("Enter your first integer:"))
SecondInteger = input("Enter your second ninteger:")
def PositveOrNegative(num1, num2):
{
if num1 == 0 or num2 == 0:
print("You have entered zero as one of the integers. Please choose a non-nuetral number.")
elif num<1 and num2>0:
print("FirstInteger is negative and SecondInteger is positive")
elif num2 < 0 and num1 > 0:
print("FirstInteger is positive and SecondInteger is negative")
}
PositveOrNegative(FirstInteger, SecondInteger)
Aucun commentaire:
Enregistrer un commentaire