本文共 580 字,大约阅读时间需要 1 分钟。
这个 ‘\’符号的作用是连接变量或者代码过长,仔细看下面代码,理解它的用法:
#!/usr/bin/python# -*- coding: utf-8 -*-import MySQLdba = "https://blog.51cto.com"\ "dinghanhua/p/"\ "9900775.html"print ab= """第一行第二行第三行"""print bc = "thins line is toooooooooooo\lone"print "c: ",cd = "https://blog.51cto.com/\dinghanhua/p/\9900775.html"print "d: ",dprint "thins line is toooooooooooo\lone"
上面的输出结果
https://blog.51cto.com/dinghanhua/p/9900775.html第一行第二行第三行c: thins line is tooooooooooooloned: https://blog.51cto.com/dinghanhua/p/9900775.htmlthins line is toooooooooooolone
转载于:https://blog.51cto.com/weiruoyu/2358586