How to write comments in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How to write comments in Python?

You can use the quick access method to comment on several lines

8th May 2022, 1:43 PM
F_Tref
3 Answers
+ 2
Have a google search :)
8th May 2022, 1:50 PM
NEZ
NEZ - avatar
+ 2
Use hashtag(#) for single line comments. Everything after (#) will be commented. Or use triple quotes(''' ''') for commenting multiple lines. like this: ''' import math print(math.sqrt(25)) ''' Here this code won't run because it is inside triple quotes.
8th May 2022, 1:57 PM
Sandeep
Sandeep - avatar
0
Check the short cut options of your editor. You need to select the lines before you press the short cut.
8th May 2022, 1:53 PM
Lisa
Lisa - avatar