Python-Routine1

转义序列(escape sequence)由\和紧跟其后的一个字符组成,它可以使我们在字符串里用上特殊字符,如反斜杠,双引号,单引号,换行(\n),前进制表符(\t),及使电脑蜂鸣器发出响声(\a)。
字符串的连接:+可用于两个字符串的无缝连接,如print(“you can concatenate two”+”strings with the ‘+’operator”),要想有空格,要自己在例子中的two后面自己加一个空格。如:

print("You are so beautiful"\
+" you know that")
 print("You are so beautiful",\
 "you know that")

字符串的重复:举例子print("Pie "*10)

猜你喜欢

转载自blog.csdn.net/qq_33158266/article/details/81436168