8.7 - Docstrings and Comments
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What is a single-line comment in Python?
💡 Hint: Look for the symbol that identifies a comment.
How do you create a docstring?
💡 Hint: Think about how you would write a multi-line description for a function.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What symbol is used for a single-line comment in Python?
💡 Hint: Think about what denotes a comment in your code.
True or False: Docstrings can only be used for functions.
💡 Hint: Consider where else documentation might be needed in Python.
1 more question available
Challenge Problems
Push your limits with advanced challenges
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.
💡 Hint: 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.
💡 Hint: Imagine you're the reader of that script; how would you feel?
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.