triple single quote,double quote? dot? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

triple single quote,double quote? dot?

this lesson does descript the syntax, triple any strings?

10th Nov 2016, 1:26 AM
jerry Tang
jerry Tang - avatar
2 Answers
+ 1
Triple any quotes behave as docstrings. >>> tdq="""triple ... double ... quotes""" >>> >>> tdq 'triple\ndouble\nquotes' >>> tsq='''triple single ... quotes''' >>> tsq 'triple single\nquotes' Dots: >>> class boo(): ... def __init__(self): ... print("init boo!") ... def method(self): ... print("class method!") ... >>> b=boo() init boo! >>> b.method() class method! Also for class properties: >>> import math as m >>> m.pi 3.1415926535897931
10th Nov 2016, 7:24 AM
Kirk Schafer
Kirk Schafer - avatar
0
Triple quotes commets things out, sing and double are the same, basically whatever you prefer is okay.
10th Nov 2016, 6:57 AM
Avery
Avery - avatar