1. 双引号括起来的字符串,打印出来也是单引号
>>> "hello world"
'hello world'
2.使用单引号
>>> 'hello world'
'hello world'
3.单双引号混合使用
>>> "let's go"
"let's go"
>>> '"hello world" she said'
'"hello world" she said'
4.单单,双双使用
>>> 'let's go'
File "<stdin>", line 1
'let's go'
^
SyntaxError: invalid syntax
>>> ""hello world" she said"
File "<stdin>", line 1
""hello world" she said"
^
SyntaxError: invalid syntax
5.上记可以用转义符
>>> 'let\'s say "hello world"'
'let\'s say "hello world"'
6.还可以用拼接实现
>>> "let's say " '"hello world"'
'let\'s say "hello world"'
7. 字符串拼接
>>> x = "hello"
>>> y = "world"
>>> x y
File "<stdin>", line 1
x y
^
SyntaxError: invalid syntax
>>> x + y
'helloworld'
>>>