`if mousePressed:`

No parens in conditional expressions in Python.