[Python] How to write a string literal containing both single and double quotes?

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

  1. Stack

    Stack Membro Participativo

    In Python how would I write the string '"['BOS']"'.

    I tried entering "\"['BOS']\"" but this gives the output '"[\'BOS\']"' with added backslashes in front of the '.

    Continue reading...

Compartilhe esta Página