Mô tả

Learn to write Clean Python Code following the Official Python Style Guide and Python Best Practices. Expand your skills with engaging video lectures, diagrams, quizzes, articles, and additional resources.

This course is your Python Best Practices Handbook where you can find Python best practices and tips to write "pythonic" code.

Learn to Write Clean Python Code and Take your Python Skills to the Next Level

  • Write clean, readable, and maintainable Python code.

  • Assign meaningful names to your variables, functions, classes, and methods.

  • Learn how to indent Python code following the Python Style Guide.

  • Apply Python best practices for line length, line breaks, and blank lines.

  • Use whitespaces appropriately with variables, parentheses, operators, commas, colons, and semicolons.

  • Learn Python best practices to write comments in your code and why they are helpful to write readable code.

  • Apply Python best practices to work with strings, sequences, operators, functions, loops, files, and object-oriented programming.

  • Plus, learn additional tips to write "pythonic" code (the walrus operator, list comprehension, dictionary comprehension, and more...)


Course Updates

The course is frequently updated with new lectures, projects, and resources:

  • September 2023 - NEW! Code editor updated to Visual Studio Code.

  • September 2023 - NEW! Updated the PDF course study guide.

  • September 2023 - NEW! Updated lectures with a new style.

  • August 2023 - NEW! New discussion topics.

  • August 2023 - NEW! Updated articles.


Python and Clean Code: In-demand Skills Around the World

Python is currently one of the most popular programming languages and its popularity continues to rise every year. It is used for real-world applications in diverse areas such as Web Development, Data Science, Machine Learning, Artificial Intelligence and many more.

If you are learning Python or if you already have some experience with this language, learning how to write clean, readable, and concise Python code following the best practices of the language is your next step into the amazing and powerful world of Python.


Learning Material & Resources

Throughout the course, you will find these resources:

  • Video Lectures: video lectures with carefully designed graphics and diagrams. You will learn the best practices of each topic with illustrative examples.

  • Quizzes: check your knowledge with 45+ quizzes with 213+ questions that provide unlimited attempts and instant feedback.

  • Articles: read articles with detailed explanations and illustrations to complement your knowledge.

  • Study Guide: review for the course exam with a detailed and unique PDF study guide with 120+ questions.

  • Course Exam: take a final course exam with 30+ questions to test your knowledge. The exam has unlimited attempts and detailed results for each attempt.


What makes this course unique?

This course is unique because of its emphasis on providing visual and detailed explanations of the best practices of Python. You will not only learn how to use these principles in Python, you will understand the purpose of each guideline and visualize it.

Unique study materials complement the course experience. You will find a PDF study guide specifically designed for the course with 120+ questions on the course content.

You will check your knowledge with Quizzes that will make you think more deeply about the topics presented in each section and you will receive instant feedback to check your answers.

You will receive a Certificate of Completion that you can add to your CV and social media profiles to showcase your new skills.

You will also have Lifetime Access to the course.


You are very welcome to watch the preview lectures and check out the full course curriculum.

If you are looking for an engaging, visual, and practical course, then you've found it.

Enroll now, add "Python Best Practices" and "Clean Code" to your resume, and showcase your new skills.

Bạn sẽ học được gì

How to write Clean Python Code following the Python Style Guide (PEP 8).

Best practices for naming variables, functions, classes, methods, and sequences.

Best practices for indentation, line breaks, blank lines, and whitespaces in Python.

How to write clean Python loops with enumerate(), zip(), break, and the else clause.

Best practices to work with Object-Oriented Programming in Python.

How to work with files following the Python Style Guide.

Tips to write more "pythonic" code (swap variables, list comprehensions, merge dictionaries, the walrus operator, and more).

How to document your code with block comments, in-line comments, and docstrings.

Yêu cầu

  • You should have basic Python knowledge.
  • The course will teach you the best practices for each topic, assuming you have some prior knowledge.
  • You should have Python 3 installed and a code editor to write your code.
  • During the lectures, we will use Visual Studio Code but you can use any code editor of your choice.
  • Enthusiasm and dedication to learn how to write clean, concise, and readable Python code.

Nội dung khoá học

15 sections

Welcome to the Course: Python Best Practices

4 lectures
Importance of Writing Clean Code
05:28
Welcome to the Course - Important Course Information
02:17
Introduce Yourself and Share your Goals
00:21
When to Follow PEP 8 Guidelines (and When Not To)
00:58

Variables Best Practices in Python

12 lectures
Welcome to this Section
00:43
Naming Conventions in Programming
05:42
Naming Conventions in Programming
5 questions
Variable Naming Rules and Conventions in Python
05:09
Variable Naming Best Practices
11:21
Variable Names That You Should Avoid in Python
00:24
How to Solve Naming Conflicts with Python Keywords
03:58
Naming Rules and Guidelines
6 questions
Constants in Python
05:14
Constants in Python
3 questions
Boolean Variables: Naming Conventions
00:34
Discussion Topic: Share your Thoughts
00:07

Indentation Best Practices in Python

11 lectures
Welcome to this Section
00:40
Importance of Indentation in Python
02:38
Indentation Guidelines (Tabs vs. Spaces)
02:59
Important Concept: Hanging Indentation
01:27
Indentation Guidelines
5 questions
How to Indent and Unindent Code in Visual Studio Code
01:11
Tabs to Spaces and Spaces to Tabs
01:10
Change Spaces per Level of Indentation in Visual Studio Code
01:56
Indentation Best Practices for Multi-line Conditions
06:18
Indentation Best Practices in Python
4 questions
Discussion Topic: Share your Thoughts
00:07

Lines Best Practices: Break, Length, and Blank Lines

13 lectures
Welcome to this Section
00:42
Line Length Limit
01:44
Line Length Limit
3 questions
Implied Line Continuation in Python
06:26
Line Breaks with Backslashes
02:55
Implied Line Continuation vs. Backslashes
7 questions
Binary Operators and Line Breaks
04:50
Binary Operators and Line Breaks
3 questions
Avoid Writing Compound Statements in a Single Line
06:05
Avoid Compound Statements
3 questions
Blank Lines in Functions, Methods, and Classes
07:04
Blank Lines in Python
5 questions
Discussion Topic: Share your Thoughts
00:08

Whitespaces Best Practices in Expressions and Statements

11 lectures
Welcome to this Section
00:39
Whitespace and Variables
02:54
Whitespaces and Variables
4 questions
Whitespace and Parentheses, Brackets, and Braces
04:57
Whitespaces and Parentheses
5 questions
Whitespace and Commas, Colons, and Semicolons
02:12
Whitespaces and Commas, Colons, and Semicolons
3 questions
Whitespace and Operators
07:18
Whitespaces and Operators
6 questions
Trailing Whitespaces Best Practices
00:23
Discussion Topic: Share your Thoughts
00:07

Comments and Docstrings Best Practices

14 lectures
Welcome to this Section
00:48
Importance of Comments to Write Clean Code
04:26
Bad Practice: Over-Commenting Your Code
05:36
Commenting Basics
5 questions
Inline Comments
04:31
Inline Comments
6 questions
Block Comments
04:35
Block Comments
4 questions
Introduction to Docstrings
05:26
One-Line Docstrings
08:39
Multi-Line Docstrings
07:13
Print and Read Docstrings with __doc__
00:56
Docstrings Best Practices
8 questions
Discussion Topic: Share your Thoughts
00:07

Strings Best Practices in Python

12 lectures
Welcome to this Section
00:48
Single-Quoted vs. Double-Quoted Strings
05:28
Triple-Quoted Strings Best Practices
00:39
String Quotes Guidelines
5 questions
Spaces in String Slicing
06:09
Spaces in String Slicing
8 questions
String Methods vs. The string Module
00:35
How to Concatenate Strings to Optimize Performance
04:15
How to Check Prefixes and Suffixes
04:52
String Methods
4 questions
Whitespace in Python Strings (+ How to Trim Whitespace)
00:36
Discussion Topic: Share your Thoughts
00:08

Operators Best Practices in Python

13 lectures
Welcome to this Section
00:57
Quick Tip: How to Leave or Update Your Review
00:18
Parentheses in Expressions and Statements
06:19
Comparison Operators Chaining
06:23
Parentheses and Comparison Operators Chaining
5 questions
The is Operator: Comparison to None
05:23
is not ... vs. not ... is
02:20
Best Practices for the is Operator
3 questions
Truthy and Falsy Values
06:50
Example of Truthy and Falsy Values
00:46
Truthy and Falsy Values for Comparisons
6 questions
Quick Review: Operators, Spaces, and Line Breaks
00:43
Discussion Topic: Share your Thoughts
00:08

Sequences Best Practices (Lists, Tuples, and Dictionaries)

10 lectures
Welcome to this Section
00:37
How to Write Multi-Line Constructs (Lists, Tuples, Dictionaries)
04:13
How to Write Multi-Line Constructs (Lists, Tuples, Dictionaries)
4 questions
Sequences as Truthy and Falsy Values in Conditionals
05:11
Sequences as Truthy and Falsy Values in Conditionals
6 questions
List Comprehension (+ When to use it)
15:17
List Comprehension
7 questions
Dictionary Comprehension
06:16
Dictionary Comprehension
3 questions
Discussion Topic: Share your Thoughts
00:08

Functions Best Practices in Python

11 lectures
Welcome to this Section
00:59
Functions Naming Guidelines
06:05
Functions Best Practices
04:57
Functions Basic Guidelines
6 questions
Blank Lines in Functions
00:23
Parameters and Arguments Best Practices
05:53
Multi-line Parameters Lists
06:20
return Statement Best Practices
05:07
Whitespaces, Keyword Arguments, and Default Values
06:18
Functions Best Practices
6 questions
Discussion Topic: Share your Thoughts
00:08

Write Clean Python Loops (Tips + Tools)

14 lectures
Welcome to this Section
00:52
How to Iterate Over Sequences Using a For Loop
05:58
Iterating Over Sequences
4 questions
How to Define Multiple Loop Variables in a For Loop
04:37
Multiple Loop Variables
5 questions
Iterate Over Sequences and Indices Using enumerate()
06:45
enumerate(): Optional start Parameter
00:51
Basics of enumerate()
6 questions
Iterate over Multiple Sequences using zip()
05:46
Basics of zip()
6 questions
The break Statement in Python
00:50
The else Clause in Python Loops
06:34
The else Clause in Python Loops
4 questions
Discussion Topic: Share your Thoughts
00:09

File Handling Best Practices

6 lectures
Welcome to this Section
00:46
Handling Files with Context Managers
08:00
Open Modes: Read, Write, Append
07:19
How to Open Multiple Files with Context Managers
05:23
File Handling Best Practices
5 questions
Discussion Topic: Share your Thoughts
00:08

Object-Oriented Programming (OOP) Best Practices

16 lectures
Welcome to this Section
01:15
Class Naming Conventions
03:49
Class Naming Conventions
5 questions
Best Practices for Blank Lines in Class Definitions
00:33
Public vs. Non-Public Attributes in Python
11:09
Properties and @property
02:12
Attributes in OOP
6 questions
Methods Naming Conventions and Best Practices
00:32
Methods First Arguments (self, cls)
06:47
Methods in OOP
3 questions
How to Compare Object Types
03:54
How to Import a Class
05:01
Implement Rich Comparison Methods
08:49
Inheritance Best Practices
00:37
Python OOP Best Practices
5 questions
Discussion Topic: Share your Thoughts
00:08

How to Write Pythonic Code

14 lectures
Welcome to this Section
00:49
Trailing Commas Best Practices
04:09
Trailing Commas Best Practices
3 questions
Swap Variables with Tuple Assignment
02:03
Swap Variables
3 questions
Reverse a String
02:01
Reverse a String
1 question
Merge and Update Dictionaries
01:45
Merge and Update Dictionaries
4 questions
Use map() to Process Iterables without a Loop
03:17
The map() Function
2 questions
The Walrus Operator in Python
06:27
The Walrus Operator
3 questions
Discussion Topic: Share your Thoughts
00:08

Final Steps: Course Exam and Congratulations

5 lectures
Study Guide and Instruction for the Course Exam
01:17
Course Exam
31 questions
Congratulations! You Finished the Course
00:20
Download Your Certificate and Share your Thoughts
01:12
Bonus Lecture
00:24

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.