I’m guessing that you’re curous about docstrings and comments rather than documentation (if not, see the last paragraph).
Comments are relatively straightforward though they’re less commonly used in production code and they’re generally included to help developers or anyone who actually has to read your code, e.g. explaining a particularly odd piece of code or warning about possible deprecation/incompatibility etc. etc. but they should probably be kept to a minimum. Ideally the code explains itself.
Docstrings are handy for anyone who will be using that package/module etc. as they’re intended to quickly describe the purpose of a particular piece of code and any relevant inputs and so on to allow you to use/loosely understand imported functions and classes without explicitly reading the actual source. You’ll genenrally find a docstring at the head of a module and on every function and class in any well maintained library-
If you’re intending to add them have a look at a few style guides to get a handle on how they’re often laid out and the possible options (e.g. google/numpy/epy style) and perhpas have a quick look at packages like Sphinx which are handy for making documentaton from your original code.
If you meant documentation then that can refer to quite a few things included the manuals and guidance for the language or one of the many packages that have been created for it.
e.g. official Python doccumentaiton- https://docs.python.org/3/index.html
Third party numpy library documentation- https://numpy.org/doc/
What exactly are you confused about? Comments are meant to explain what your code is doing so that others, or your future self, can understand the code. Comments are not executed as part of the code; they are ignored.
i can’t use the print function after writing a comment. tried switching multiple lines but the computer was not reading it. the color change that marks that print function was activated was also not there. would like to ask whether it’s a system error or that print function doesn’t work after writing a comment?
Do you have formatted code to post? Or, maybe a screenshot so we can see what you’re referring to?
Perhaps I’m not completely understanding your question(?). But, for reference, you can’t print a comment. Anything that follows # is commented out and only appears in the code, not output of code.
print("this will print to the console.") #this will not.