This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Description
Discussed in #346
Originally posted by jdonwells February 11, 2022
Python has something called a docstring to add documentation to a function in a standardized way.
3.02 shows this:
# Name: multiply_by_two
# Purpose: multiplies a given number by 2
# Input: number to multiply (int)
# Output: int
def multiply_by_two(a):
c = a * 2
return c
Instead, I would recommend this:
def multiply_by_two(a):
"""
Name: multiply_by_two
Purpose: multiplies a given number by 2
Input: number to multiply (int)
Returns: int
"""
c = a * 2
return c
Many IDEs will know about docstrings and display them as you write code.