#100DaysOfCode in Python Transcripts
Chapter: Days 34-36: Refactoring / Pythonic code
Lecture: Lesson introduction

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Welcome back to the 100 Days of Python. In the coming 3 days I will guide you through refractoring and writing Phythonic code.
0:09 One thing is to write Python, the other thing is to really leverage all the great stuff Python has. The Zen of Python states there should be one
0:18 and preferably one way to do something, and that's great because in Python there usually is one best
0:25 way to something, and the more you know these constructs and idioms, the more readable and elegant your code will become.
0:32 For this lesson I've prepared a Jupyter notebook with 10 practical examples how you can improve your code. For example use a with statement
0:41 instead of a try, accept, finally block. Or use enumerate to not keep a manual counter or what about refractoring a long if,
0:51 elif else statement using a dictionary. We will touch upon list comprehensions, generators, using explicit is better than implicit
1:00 in your exceptions, string formatting, tuple unpacking, PEP 8, the Zen of Python, and even some common best practices writing maintainable code.
1:10 And for day two and three I have you refractor your code or the code of somebody else to really put into practice what you've learned.
1:18 So there's a lot to cover, I'm really excited. Let's dive straight in.


Talk Python's Mastodon Michael Kennedy's Mastodon