+ 1
Why is there no quote in the output
print("Hello\nWorld!")
4 ответов
+ 4
The quotes signify a string, to add quotes you need to add a second set inside the first and escape them:
print(“\”Hello\nWorld!\””)
+ 2
code?
+ 2
printing strings by themselves will not give quotes. Use string repr.
print("{}\nWorld!".format(repr("Hello")))
'Hello'
World!
+ 2
Thanks guys I get it now🙏