Python why is this invalid syntax

Question:

I’m fairly new to python and I have received an invalid syntax error.

res = (True in (!(((point[0] > (p[0] - 5)) and (point[0] < (p[0] + 5))) and ((point[1] > (p[1] - 5)) and (point[1] < (p[1] + 5)))) for p in pointsClicked))

I’ve looked at this for a bit and have no idea what is causing the problem.

Asked By: Wyatt Knepp

||

Answers:

Python does not have a ! operator. Use the not operator instead.

Answered By: mipadi
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.