Member-only story
Perfectly Pythonic Python Stuff That You Should Definitely Know
Write Simple and Elegant Codes like a Python Zen Master
Most of us have some go-to functions when we code. Once we are used to coding in a certain way, we tend to use the same functions over and over again, even when there may be a much better way. And, as per the Zen of Python, there should be only one — and preferably only one — obvious way to do it!
More often than I would like to admit, I have fallen in this trap as well. For example getting too used to for loops, using prints too often instead of logs and the list goes on. That is definitely not the Pythonic way to do it. You can always refresh your knowledge about being Pythonic, i.e. writing clear, concise and easy to maintain codes and much more here:
Over a period, the following 7 functionalities became my favorites to use because of their simplicity and an inherent elegance. If you haven’t till now, you should definitely try to use them whenever possible.