Python – multiline comment in PyCharm
Python language has no internal multiline comment syntax (like \* … *\ in other languages). There are two ways to solve this:
- Use multiline string literal syntax: ′′′
1 2 3 4 |
''' this is multiline comment second comment row ''' |
Disadvantage of this way is that such comment remains constant string and processed in finished code.
- If the PyCharm IDE is used to write Python code – select multiple code rows to comment and press keyshot Ctrl + / to comment all of them.
To remove comments from multiple commented strings select them and press Ctrl + / again.