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句不能是任何形式的字符串表达式


posted @ 2010-04-07 14:03  走到天亮  阅读(242)  评论(0编辑  收藏  举报