+ 2
I'm confused about the triple quotations making \n in the output. What is it for?
3 Antworten
+ 6
Triple quotes are mostly used as multiline comments, although it's not their real application. Those are string literals, meaning they store a string inside it *exactly* how it is written - kind of a Python replica of the HTML <pre></pre> tag.
Check it out - without those triples I would have to count the spaces and lines and try to fit those string adequately line after line:
https://code.sololearn.com/cwjsOELw9656/?ref=app
+ 9
triple quotations themselves are showing comment
myVar = 1
'''This is a 1st line of comment
myVar = 42'''
print (myVar)
would print 1
0
''' stands for a multi line comment
Example:
'''
This is a
Multi line comment
'''