Skip to content

Commit

Permalink
Merge pull request #447 from sstevens2/patch-2
Browse files Browse the repository at this point in the history
Online to inline help
  • Loading branch information
vahtras authored Nov 21, 2019
2 parents 807c2e5 + 78973c1 commit 64bd40e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions _episodes/18-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ objectives:
- "Use Python community coding standards (PEP-8)."
keypoints:
- "Follow standard Python style in your code."
- "Use docstrings to provide online help."
- "Use docstrings to provide builtin help."
---

## Coding style
Expand Down Expand Up @@ -56,11 +56,11 @@ def calc_bulk_density(mass, volume):

If the assertion is `False`, the Python interpreter raises an `AssertionError` runtime exception. The source code for the expression that failed will be displayed as part of the error message. To ignore assertions in your code run the interpreter with the '-O' (optimize) switch. Assertions should contain only simple checks and never change the state of the program. For example, an assertion should never contain an assignment.

## Use docstrings to provide online help.
## Use docstrings to provide builtin help.

* If the first thing in a function is a character string
that is not assigned to a variable,
Python attaches it to the function as the online help.
that is not assigned directly to a variable,
Python attaches it to the function as the builtin help variable.
* Called a *docstring* (short for "documentation string").

~~~
Expand Down

0 comments on commit 64bd40e

Please sign in to comment.