25 Tips and Tricks to Write Better Python Code For Beginners

Опубликовано: 05 Октябрь 2024
на канале: Shilleh
877
62

Please consider supporting this channel if you find my content helpful!
https://www.buymeacoffee.com/mmshilleh

I go through multiple Python tips to help you in practice, in a professional setting, or in coding interviews. These tips include ways to improve the readability/maintainability of your code, improve efficiency, and learn aspects of the Python language you may have never heard of!

If you would like to show your support so I can continue providing useful content, would be highly appreciated:
https://www.buymeacoffee.com/mmshilleh

TIMESTAMPS
00:00 Background/Intro
00:31 Organize Imports
01:36 PDB
04:18 Match/Case
06:33 Bisect Library
8:07 Walrus Operator
10:12 Enumerate over Range
11:22 Numpy for Efficiency
12:51 cProfile for Bottlenecks
14:45 Catch-all Unpacking
16:32 Prefer f-strings
18:42 Naming Variables
20:44 Generators over Lists
23:13 .get() Method
26:01 Specific Exceptions
26:54 .zip() Method
28:33 Loops with Else Statements
30:20 Write Docstrings
32:04 Be cautious with Python Dict Order
33:28 List Comprehension Tip
35:00 Use Dictionary Comprehension
35:55 Avoid one-line if/loops
36:41 Don’t check for empty containers/sequences
37:30 Split Long Lines
38:24 Add new-line
39:19 … Practice
41:18 Outro