2 ответов
+ 4
They're identical. If your string contains 1 ore more double quotes, you can use single quotes to surround it and vice versa:
a = 'Hello "World"!'
print (a)
b = "Hello 'World'!"
print (b)
- 1
its recommended you use doubles but they do the same thing, double quotes allow the use of ' and singles allow the use of " . but i myself normally use triple double quotes for strings containing quotations """ string """