Getting a syntax error in Python - what's the most common fix? or Why am I getting a syntax error in

20 Replies, 1278 Views

Oh man, syntax error python is the worst! One sneaky thing I’ve run into is forgetting a comma in a list or dict. Like, if you’re defining a tuple with one item and forget the trailing comma, Python gets mad.

Also, have you tried pasting your code into a linter like pylint or flake8? Sometimes those catch things your eyes glaze over.

Messages In This Thread



Users browsing this thread: 1 Guest(s)