New course! Every coder should learn Generative AI!
Try a free lesson+ 11
""" if you're lazy you can just do this """
+ 7
"Tinashe"
+ 6
Envelop the double quotes in single quotes for the former to be printed out.
print('Sam "Tinashe" Truscott')
>>>
Sam "Tinashe" Truscott
+ 5
"like this"
+ 3
You can also use \ (backslash) as an escape character for double quotes.
Example (Python):
print("Hello \"World\"")
Output: Hello "World"
-Note that I'm only using double quotes and this is possible because I used the backslash to escape those two double quote characters.
Here's a list of things you can do with backslash in your strings:
\' single quote
\" double quote
\\ backslash
\n new line
\r carriage return
\t tab
\b backspace
\f form feed
-Read up on escaping characters for more info
+ 1
Gavin's explanation helped me to guess it... :) Very interesting way to write stuff... I enjoy this.
0
Rather than 'blah blah blah' double quote is "blah blah blah"