QUOTATION AND COMMENTS IN PYTHON
Python allows single ('), double (") and triple (''' or """) quotes for string literals, provided that they match at the beginning and the end of the string. You can use triple quotes for strings that span multiple lines. The following examples are legal Python strings:
word = 'word' line = "This is a sentence." para = """This is a paragraph. This paragraph contains more than one sentence."""
A string literal that begins with the letter “r” (for “raw”) treats everything as a literal character and “escapes” the meaning of meta characters, as shown here:
a1 = r'\n'
a2 = r'\r'
a3 = r'\t'
print('a1:',a1,'a2:',a2,'a3:',a3)
The output of the preceding code block is here:
a1: \n a2: \r a3: \t
You can embed a single quote in a pair of double quotes (and vice versa) in...