Python真的爽,单双引号的运用太舒服了
在Python中,使用单引号或双引号是没有区别的,都可以用来表示一个字符串
1.单双引号都可以用来表达
输入:
print("Hello1")
print('Hello2')
输出:
Hello1
Hello2
2.还可以一起用,来避免混淆
输入:
print('test the " 111')
print("test the ' 222")
输出:
test the " 111
test the ' 222
3.也可以通过转义字符来避免混淆
输入:
print("test the \" 333")
print('test the \' 444')
输出:
test the " 333
test the ' 444