Python 教程之String

 python 字符转译 用“\”python 长字符串连接 ,在每行最后加上“\”

转意符:“\”


>>> testStr=" This is a rather long string containing\n\       
                        several lines of text just as you would do in C.\n\

                      ”

1 #字符串连接方式
2 >>> “my python ”+" is ok"
3 >>>  "mypython" "is ok"
4 #这两种方式是一样的。只是第2句不能是任何形式的字符串表达式


原文地址:https://www.cnblogs.com/65702708/p/1706265.html