Use the correct character for you minus operator: -
. You are using some other 'dash' character that the interpreter is considering just a name like y
or x
. But it is invalid!
>>> bad_minus = "—"
>>> good_minus = "-"
>>> bad_minus == good_minus
False
>>> ord(good_minus)
45
>>> ord(bad_minus)
8212
>>>