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.
Answers:
Python does not have a !
operator. Use the not
operator instead.
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.
Python does not have a !
operator. Use the not
operator instead.