mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-09-19 09:32:03 +08:00
chore: sync content to repo (#10185)
Co-authored-by: nilbuild <4921183+nilbuild@users.noreply.github.com>
This commit is contained in:
co-authored by
nilbuild
parent
bd8e65580c
commit
e0c4a4b86c
@@ -1,6 +1,6 @@
|
||||
# Docstrings and Comments
|
||||
|
||||
Docstrings and comments document what code does and why. A docstring is a string literal placed right after a function, class, or module definition, and it becomes accessible through the object's __doc__ attribute, which tools use to generate documentation automatically. Comments, marked with #, explain specific lines or blocks of code and are ignored by the interpreter. Docstrings typically describe the purpose, parameters, and return value of a function, while comments clarify tricky logic or note reasons behind a particular implementation choice.
|
||||
Docstrings and comments document what code does and why. A docstring is a string literal placed right after a function, class, or module definition, and it becomes accessible through the object's **doc** attribute, which tools use to generate documentation automatically. Comments, marked with #, explain specific lines or blocks of code and are ignored by the interpreter. Docstrings typically describe the purpose, parameters, and return value of a function, while comments clarify tricky logic or note reasons behind a particular implementation choice.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
|
||||
@@ -6,4 +6,5 @@ Visit the following resources to learn more:
|
||||
|
||||
- [@official@Built-in Functions in Python](https://docs.python.org/3/library/functions.html)
|
||||
- [@article@Defining Python Functions](https://realpython.com/defining-your-own-python-function/)
|
||||
- [@article@How to Return Multiple Values in Python (and When to Use Each Method)](https://roadmap.sh/python/return-multiple-values)
|
||||
- [@article@How to Return Multiple Values in Python (and When to Use Each Method)](https://roadmap.sh/python/return-multiple-values)
|
||||
- [@article@Master Python Filter: Syntax, Examples, and Best Practices](https://roadmap.sh/python/filter)
|
||||
Reference in New Issue
Block a user