This article will tell you three methods about how to add comments to multiple lines in python source code.
1. Three methods to add comments in python source code.
- First, select the paragraph to be commented in python source code, and then press
"Ctrl + /"
on Windows,"Command + /"
on macOS to comment the selected multiple lines of code. The effect is as follows. If you want to cancel the comments, you can press"Ctrl + /"
on Windows,"Command + /"
on macOS again to uncomment the comments.# # Create an instance of etree.HTMLParser class. # html_parser = etree.HTMLParser() # # # Use the python requests module get method to get the web page object with the provided url. # web_page = requests.get(page_url)
- Press
"Shift + #"
in front of each python source code line to comment on each line then it will comment on all the lines. - You can insert the commented python source code in
''' python source code '''
or""" python source code """
to implement multiple python source code lines comments.
Ballsakz
Pp