What Are the Most Common Mistakes People Make with Syntax in Python? or How Important Is Proper Synta

14 Replies, 1029 Views

The fact that you can do `[1, 2][True]` and get `2` because `True` is `1` is hilarious and terrifying. Python’s type system is *flexible* to a fault.

Also, `try...except` with no exception type catches *everything*, even `KeyboardInterrupt`. Learned that the hard way when my script wouldn’t die.

For quick experiments, Jupyter Notebooks are awesome. Lets you test syntax in python line by line without rerunning the whole script.

Messages In This Thread



Users browsing this thread: 1 Guest(s)