So I wish to print out "It's awesome" with the quotes
Note not print out It's awesome
Thanks a lot
So I wish to print out "It's awesome" with the quotes
Note not print out It's awesome
Thanks a lot
Escape your strings using \"
or use single quotes '
print("\"It's awesome\"")
print('"It\'s awesome"')
If you don't wanna escape the quotes for some reason. Note that 34 is the ascii code for "
print("{}It's awesome{}".format(chr(34), chr(34)))
>>> print("\"It's awesome\"")
"It's awesome"
Escape the quotes in the print statement
Escape quotes using \
If you are using a print statement. It should look something like this:
print("\"It's awesome\"")
In addition, to the great answers mentioned here, you can also use a multiline-string without having to usually worry about escaping characters. :) . The way you can write this is by using triple quotes. For example, you can try something like:
print(r''' "It's awesome" ''')