About 111,000 results
Open links in new tab
  1. How to comment out a block of code in Python [duplicate]

    The creator of python actually suggests to use multi-line strings as block comments, so I would say your statement "Don't use triple-quotes" isn't appropriate.

  2. 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 …

  3. python - Proper use of comments - Stack Overflow

    Sep 23, 2017 · Inline-comments = Explanation of why the code is written the way it is written. See the requests library for a great example of a project that uses comments appropriately. When …

  4. 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 …

  5. Why doesn't Python have multiline comments? - Stack Overflow

    Dec 29, 2008 · Multi-line comments aren't inherently breakable; it's just that most implementations of them are (including Python's). The obvious way to do multi-line comments in Python, to my …

  6. Is there a shortcut to comment multiple lines in python using VS …

    Sep 26, 2022 · Instead of indivually typing out a hash tag in front of each line, is there a way to select a block of code and comment/uncomment everything by only pressing a couple shortcut …

  7. python - Why are docstrings and block comments suddenly the …

    Jun 13, 2023 · They use to be: docstrings & block comments: orange single line comments: green I did a reinstall of Visual Studio Code this morning and the block comments and docstrings are …

  8. 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.

  9. python - What is the shortcut key to comment multiple lines using ...

    Feb 8, 2022 · This heavily depends on where you're writing your python code. If you're writing it in Notepad, there won't be a shortcut for commenting a line. However, if you use an IDE, you will …

  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 …