+ 1
When should I use the three single or double qoutes? What is the difference between using three qoutes and the normal one?
2 ответов
+ 1
use those for multiline strings or comments and docstrings
docstring example:
def func(a,b):
"""Returns addition of both numbers"""
return a+b
#used in docstrings to explain what something does
string/comment example:
'''This is a comment
with more than 1 line'''
paragraph = '''This is the start of the multiline string.
This is the middle.
And this is the end. '''
+ 3
''' for comments, " or ' for strings