Write good comments for improved confidence and collaborative abilities. In Python, that means following the PEP8 style guide.
Comments should be declarative, like:
# Fix issue with utf-8 parsing
NOT # fixes issue
Here’s an example with a docstring, a special type of comment that is used to explain the purpose of a function:
def persuasion():
"""Attempt to get point across."""
print('Following this advice about writing proper Python comments will make you popular at parties')
Docstrings are particularly useful because your IDE will recognize this string literal as the definition associated with a class. In Jupyter Notebook, you can view a function’s docstring by putting your cursor at the end of the function and simultaneously hitting Shift and Tab.