python 数据类型 单引号与双引号
s1 = 'hello' s2 = "world" s3 = '''If you not leave me, I will by your side until the life end!''' s4 = """If you not leave me, I will by your side until the life end!""" print(s3,type(s3))#单引号字符串类型 print(s4,type(s4))# # 多行字符串 s5 = 'hello' \ 'world' print(s5,type(s5)) s6 = 'hello\ world' print(s6,type(s6)) # 转易:\,可以是有特殊含义的字符失去意义,变成普通字符 s7 = 'I\'ll' print(s7,type(s7)) s8 = 'hello\\nworld' print(s8,type(s8))#//与r等效作用 # 原生字符串,中间的任何内容都没有特殊含义 s9 = r'hello\nworld' print(s9,type(s9))
单引号和双引号无区别