# 1.在一个字符串中,行末的单独一个反斜杠表示字符串在下一行继续,而不是开始一个新的行。
"This is the first sentence.\
This is the second sentence."
#等价于"This is the first sentence. This is the second sentence."
#2.
a = r'dsfg' #标示自然的字符串(不管转义)
a = u'sdgd' #使用unicode编码
#3. Python假定每个物理行对应一个逻辑行。
#如果你想要在一个物理行中使用多于一个逻辑行,那么你需要使用分号(;)来特别地标明这种用法。分号表示一个逻辑行/语句的结束。
简明python教程 (笔记)一
猜你喜欢
转载自blog.csdn.net/fhb362767625/article/details/86072377
今日推荐
周排行