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

14 Replies, 1120 Views

The most confusing thing for me was chained comparisons. Like `1 < 2 < 3` evaluates to `True` because Python secretly reads it as `1 < 2 and 2 < 3`. Neat, but why not just write it the long way?

And don’t get me started on `__dunder__` methods. Why does `__str__` exist if `__repr__` is there? Feels like overcomplicating things.

For quick checks, I use the REPL constantly. Just type `python` in your terminal and test snippets live. No better way to learn syntax in python!

Messages In This Thread



Users browsing this thread: 1 Guest(s)