New course! Every coder should learn Generative AI!
Try a free lesson0
[Solved] What does document your code means?
I was surfing q/ans section and I found this https://www.sololearn.com/discuss/137697/?ref=app What will this mean? (point 7 in the question)
1 Answer
+ 6
Document means to comment or to explain a particular class or function.
For example in Python, we use DocStrings to describe functions etc.
def add(num1, num2):
"""
This is the document or
docstring.
This returns the sum
of two numbers.
"""
return num1 + num2
Docstrings or comments are useful for explanation and summary of the purpose of a specific block of codes. This is also important between programmers to understand each other's codes.