But what if you want to include a single quote in a single-quoted string (or a double quote in a double-quoted string)? Normally | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 1

But what if you want to include a single quote in a single-quoted string (or a double quote in a double-quoted string)? Normally

But what if you want to include a single quote in a single-quoted string (or a double quote in a double-quoted string)? Normally this would confuse Python and break the code, that is unless you escape the quotes using a backslash.

3rd Apr 2021, 7:45 AM
ą¤²ą¤®ą¤¾ą¤“ NOOB
ą¤²ą¤®ą¤¾ą¤“ NOOB - avatar
1 Resposta
+ 2
The "Normal" way is to escape using a backslash. As I understand, there's no more "Normal" way than that, honestly.
3rd Apr 2021, 7:48 AM
Ipang