Home python Nested quotes in the python row

Nested quotes in the python row




What is the full list of ways in python you can write a string containing nested quotes?

quote = "\" "

Answer 1, Authority 100%

Using Escape sequences:

quote = "\" "
quote = "\ 42"
quote = "\ x22"

Using Single Quotes:

quote = '"'

Using triple quotes:

quote = \
"" "
"" "

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions