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

14 Replies, 1092 Views

Ever tried `sum([True, False, True])`? It gives `2` because `True` is `1` and `False` is `0` under the hood. Makes sense but feels *wrong* somehow.

Another head-scratcher: `a += b` isn’t always the same as `a = a + b`. Try it with lists and you’ll see what I mean.

For deep dives, the Python docs (docs.python.org) are dry but *so* thorough. Just Ctrl+F for the syntax in python bit you’re stuck on.

Messages In This Thread



Users browsing this thread: 1 Guest(s)