About 50 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 effect, it acts exactly …

  3. Is there a shortcut to comment multiple lines in python using VS Code ...

    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 keys?

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

    Mar 2, 2010 · A docstring isn't a comment, and people often want to include things in function-level comments that shouldn't be part of documentation. It's also commonly considered that documenting …

  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 - Comment/Uncomment multiple lines in JupyterNotebook …

    May 12, 2021 · CTRL+/ for comment and uncomment multiple lines you can press 'h' anywhere in command mode, you can find all the shortcuts of jupyter.

  7. python - comment out nested triple quotes - Stack Overflow

    May 21, 2012 · Python doesn’t have nesting multiline comments, it’s as simple as that. If you want to comment out multiple lines allowing for nested comments, the only safe choice is to comment out …

  8. How to comment code blocks in Python that contain backslashes in ...

    Jun 11, 2023 · Usually, the same key will uncomment a selected block. The triple-quote method is not really a multi-line comment, but a multi-line string, which the interpreter is parsing. Using it as a …

  9. Shortcut to comment out multiple lines with Python Tools for Visual ...

    May 30, 2011 · You misunderstand the question. Most Python editors provide a simple mechanism for adding # to multiple lines at once. I'm asking if Python Tools for Visual Studio provides such a …

  10. How do I block comment in Jupyter notebook? - Stack Overflow

    I want to comment out a block of multiple lines in Jupyter Notebook, but can't find out how to do that in this current version. It used to be in one of the drop down menus but is no longer there. How do you …