Python – multiline comment in PyCharm

Python language has no internal multiline comment syntax (like \* … *\ in other languages). There are two ways to solve this:

  1. Use multiline string literal syntax: ′′′

Disadvantage of this way is that such comment remains constant string and processed in finished code.

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

5 2 votes
Article Rating
Subscribe
Notify of
0 Комментарий
Inline Feedbacks
View all comments