0
when do we get a single quoted output and when do we get output with no quote??
2 Antworten
+ 2
>>> string = "hello\nworld"
>>> print(string)
hello
world
>>> print(repr(string))
'hello\nworld'
+ 1
print("Hello world")
#Output: Hello world
print("\"Hello world\"")
#Output:"Hello world"
For printing quotes we use escape sequence.. otherwise string will only be printed
some other ways to print quotes:
print(" ' Hello world' ")
#Output : ' Hello world '
using double quotes outside and single quotes inside and vice versa
I HOPE IT HELPS!!!🙂