+ 1
We must write code which outputs string with "" . How can we do this?(in python)
3 Respuestas
+ 1
Hi! use the character escape operator
+ 1
if you want to write string with double quotes, you could wrap your string in single quotes... and conversely
if you have both, you could escape the one used to enclose the string:
print("I'm new to \"Python\"");
also, you could enclose string in triple quotes (either single or double), so you doesn't need to escape quotes until you put 3 next to each others or 1 or more at the end of the string (in addtion, that allow multiines strings):
print("""I'm new to "Python"!
Hello world ;)""")
0
ok I will try