Python Bracket Was Not Closed