Menu
Coddy logo textTech

Comments

Lesson 20 of 28 in Coddy's Clean Code - Write better code using Python course.

PEP 8 guidelines on comments:

  • comments should not contradict the code
  • comments should be complete sentences. The first word should be capitalized
  • comments should have a space after the # char.
  • multi-line comments used in functions (docstrings) should have a short single-line description followed by more text

Again, If you want to learn more read the official PEP 8 reference.

Try it yourself

This lesson doesn't include a code challenge.

All lessons in Clean Code - Write better code using Python