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


相关文章:

  • 2022-12-23
  • 2021-07-05
  • 2021-07-04
  • 2022-12-23
  • 2021-07-06
  • 2021-11-02
猜你喜欢
  • 2021-10-04
  • 2021-12-13
  • 2022-02-24
  • 2022-12-23
  • 2021-07-22
  • 2021-08-01
  • 2021-08-09
相关资源
相似解决方案