About 50 results
Open links in new tab
  1. How do I create multiline comments in Python? - Stack Overflow

    111 Python does have a multiline string/comment syntax in the sense that unless used as docstrings, multiline strings generate no bytecode -- just like # -prepended comments. In effect, it acts exactly …

  2. What is the proper way to comment functions in Python?

    Mar 2, 2010 · The correct way to do it is to provide a docstring. That way, help(add) will also spit out your comment.

  3. What is the proper way to comment code in Python? [closed]

    What is the most Pythonic way of putting blank lines between comments and the actual code? I want to show my program to some experts. And want my code to look more professional.

  4. How to comment out a block of code in Python [duplicate]

    Is there a mechanism to comment out large blocks of Python code? Right now, the only ways I can see of commenting out code are to either start every line with a #, or to enclose the code in triple quotes: """.

  5. How can I comment multiple lines in Visual Studio Code?

    For python code, the "comment block" command Alt + Shift + A actually wraps the selected text in a multiline string, whereas Ctrl + / is the way to toggle any type of comment (including a "block" …

  6. python - Proper use of comments - Stack Overflow

    Sep 23, 2017 · To clarify: my question is about when to use comments instead of docstrings. Python is opinionated and seems to want to docstrings for most (all?) code description purposes. That being …

  7. Why does python use unconventional triple-quotation marks for …

    Nov 22, 2017 · Most Python IDEs let you select-and-comment a block at a time, this is how many people handle that situation. Then there are normal single-line python strings: They can use ' or " quotation …

  8. python 3.x - How to remove '#' comments from a string? - Stack …

    Feb 9, 2015 · 3 Instead of attempting to parse a Python file, it's possible to rewrite the file without comments using Python's abstract-syntax-tree (ast) to parse then unparse the code.

  9. Python multiline comments - Stack Overflow

    Aug 19, 2021 · 2 I am struggling with multi line comments in Python, I understood I can use # at the start of every line of multi line comments but there is also another way of using """ at the start and end of …

  10. python - Docstrings vs Comments - Stack Overflow

    Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, and methods. An object's docsting is defined by including a …