Member-only story
30 Simple Tricks to Level Up Your Python Coding
Better Python

As a general-purpose programming language, Python has penetrated to almost all industrial and academic fields. Based on my observation of Python programming in the areas of biomedical sciences, I realize that a considerable number of Python programmers, myself included, come from various programming backgrounds, such as Matlab, C, C++, Java, JavaScript, and Swift, not to mention some having no prior coding experience.
With Python being their “foreign” language, they may not have a systematic training on Python coding, and might not know the idiomatic way for their Python development.
But don’t get me wrong — they can still write excellent code by implementing the same functionalities in different ways, as long as the code can satisfy the intended purposes. Thus, to me, it’s acceptable to write non-idiomatic Python programs.
However, just like I’m always working to improve my English accent as a foreigner in the United States, I want my Python code to be idiomatic as much as possible. In this article, I’m sharing some idiomatic usages that I have accumulated over the last several years, which I hope will help level up your Python coding.