Skip to content

Commit

Permalink
Merge pull request #438 from datacarpentry/maneesha-patch-2
Browse files Browse the repository at this point in the history
Add a reminder about what the question mark does
  • Loading branch information
tobyhodges authored Apr 25, 2023
2 parents b45f473 + c10d144 commit 72f639f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion _episodes/06-loops-and-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,25 @@ The text between the two sets of triple double quotes is called a docstring and
contains the documentation for the function. It does nothing when the function
is running and is therefore not necessary, but it is good practice to include
docstrings as a reminder of what the code does. Docstrings in functions also
become part of their 'official' documentation:
become part of their 'official' documentation, and we can see them by typing
`help(function_name)`:

~~~
help(one_year_csv_writer)
~~~
{: .language-python }

~~~
Help on function one_year_csv_writer in module __main__:
one_year_csv_writer(this_year, all_data)
Writes a csv file for data from a given year.
this_year -- year for which data is extracted
all_data -- DataFrame with multi-year data
~~~
{: .output }

Or, when working in the Jupyter environment, adding a `?` (question mark) after the function name:

~~~
one_year_csv_writer?
Expand Down

0 comments on commit 72f639f

Please sign in to comment.