单引号&双引号 print "hello, world"
和 print 'hello, world'
是一样的。
单引号特殊用途:英语中的单引号的使用。如 print 'hello, dogs' world'
是错误的,而 print "hello, dogs' world"
是正确的。
三个双引号的用途:可以用真是的回车代替\n
。如print "hello, \nbig \nworld"
看起来就不是很舒服,于是引入了更易于人阅读的写法,如
print """hello,
big
world"""