r/pythontips • u/bhavaniravi • Oct 17 '21
Syntax Python Beginner Mistakes
As a Python trainer, I get to work with pynewbies across the spectrum. It doesn't matter whether they are from college or years into the industry when learning Python. The simplest language on the earth is not that intuitive. Things get even more challenging when they are well versed in a Typed-Object-Oriented-Language
I have compiled some of the common mistakes that beginners make.
52
Upvotes
3
u/srpwnd Oct 17 '21
I think you should mention that you could (should) write the ternary operator code as:
result = INVALID_INPUT if name == ‘’ or email == ‘’ else f”{name}\n{email}\n{designation}”