简体   繁体   中英

Python why is this invalid syntax

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM