Quotes

String literals are written in a variety of ways, including single quotes, double quotes, and triple quotes. Triple quoted strings may span multiple lines.[4] The backslash (\) character is used to escape characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character.

value = 'single quotes'
print(value)

value = "double quotes"
print(value)

value = \
'''triple quotes
    span multiple lines'''
print(value)

value = '"nested quotes"'
print(value)

value = "'nested quotes'"
print(value)

value = "\"escape character quotes\nand multiple lines\""
print(value)

results matching ""

    No results matching ""