+ 1

When should I use the three single or double qoutes? What is the difference between using three qoutes and the normal one?

29th Jul 2020, 2:05 PM
Lawrence Lawrence
Lawrence Lawrence - avatar
2 Antworten
+ 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. '''
29th Jul 2020, 2:13 PM
Slick
Slick - avatar
+ 3
''' for comments, " or ' for strings
29th Jul 2020, 2:11 PM
Julia Shabanova
Julia Shabanova - avatar