Why does this code throw syntax errors?
This is in the Code Playground as divisibility_checker1. I don't understand why it throws a syntax error at line 16. If I remove the check for division by zero, line 21 will also throw a syntax error even though identical syntax is used successfully in line 9. What gives? Am I doing the while loops wrong? # cannot figure out why this does not work print("Check any number for divisibility by any other number!") x = 1.5 y = 1.5 while x - int(x) != 0: x = float(input("Enter the number to check, i.e. the dividend: ")) if x - int(x) != 0: print("Please enter a whole number, not a decimal.") while y - int(y) != 0: y = float(input("Enter the number to divide it by, i.e. the divisor: ") if y == 0: print("No dividing by zero. Please enter a different number.") y = 1.5 if y - int(y) != 0: print("Please enter a whole number, not a decimal.") int(x) int(y) if x%y=0: print(x + " is divisible by " + y + "!") else: print(x + " is not divisible by " + y + ".")