[Python] What difference does it make to surround string literals with multiple quotation...

Discussão em 'Python' iniciado por Stack, Agosto 24, 2025.

  1. Stack

    Stack Membro Participativo

    In Python 3.x:

    print(""s"") # SyntaxError
    print("""s""") # prints s
    print(""""s"""") # SyntaxError
    print("""""s""""") # prints ""s


    What is the reason behind this different behaviour, when there are different numbers of double quotes in the string?

    Continue reading...

Compartilhe esta Página