#2/19 Why do we use """ instead of #?


#1

Hi all,

up until this lesson I have been using # for adding comments to the code. However in this lesson, it prompts us to use “”" instead for function comments?

Are these two not the same thing? If not, what is the difference/ purpose for “”" ?.


#2

we use # for single-line comment.

and if we have comments that extend multiple lines then we use """ .Though you can use # in the beginning of each line too.

for example:

"""
this
is
a
comment
"""


#this
#is
#also
#a
#comment

#3

Ah yes! Now I remember reading that a few lessons ago haha

Thank you @rcodeman


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.