+ 5
Escape Characters (Double Quotes inside String)
I know that to escape a double quote in a string. But when I was giving an example, I tried to show how to do the escape characters, meaning I tried to output my code as \“Hello\“ keep in mind that is supposed to be my output, not the code I am programming, But I cannot put \\”Hello\\” in my line of code, how do I get behind that? Also keep in mind I’m a BEGINNER, so please don’t make it too complicated, thank you.
4 Respuestas
+ 14
print(r'\"Hello\"')
print('\\"Hello\\"')
print("\\\"Hello\\\"")
+ 3
Saurabh Sharma they all print the same thing but first one looks better in my opinion
+ 2
Thanks!
+ 1
hello Mert which one is right ?