Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a single-line comment in Python?
Look for the symbol that identifies a comment.
How do you create a docstring?
Think about how you would write a multi-line description for a function.
What symbol is used for a single-line comment in Python?
Think about what denotes a comment in your code.
True or False: Docstrings can only be used for functions.
Consider where else documentation might be needed in Python.
Write a Python script that includes at least three functions, each with their own docstring. Explain what each function does when calling help on it.
Think about how you document multiple functions.
Consider a Python script with no comments or docstrings. What might be the implications for someone else reading it? Outline a potential scenario.
Imagine you're the reader of that script; how would you feel?
5 more questions in this section. Enroll free to practise them all.
Enroll free