In this Tutorial I show you 8 quick Python refactoring tips for cleaner and more pythonic code. This is part 1 of my refactoring code series. https://youtu.be/rp1QR3eGI1k Part 2 can be found here: Refactoring Part 2 1: Merge nested if statements Let’...

Markdown supported · ⌘↵ to post
Patrick Loeber
Love your writing style. Really helpful tips. Although, I have slight disagreement with point 7. If your variables are named properly, it should be understandable regardless of where it is assigned. In many cases your other team members would want to find all the assignments in the same place, don't you agree?
Sérgio Rafael Siqueira
On 6 and 7 you can remove the else, because in if condition has return statement .