python入门2 python字符串换行显示、字符串太长连接多行

#coding:utf-8
#/usr/bin/python
"""
2018-11-03
dinghanhua
缩进
换行
"""

"""python严格缩进 4个空格 通过缩进来区分语句块"""
def add(a,b):
    return a+b

def add2(a,b):
return a+b    #故意没缩进,报错IndentationError: expected an indented block


"""字符串太长换行显示 反斜杠连接多行"""
url = "https://www.cnblogs.com/" 
      "dinghanhua" 
      "/p/9900700.html"
print(url)

"""多行输出,方式1—加换行符,方式2—三重引号保持原样输出"""
str1 ="第一行
第二行
第三行"

str2= """第一行
第二行
第三行"""

print(str1)
print(str2)
原文地址:https://www.cnblogs.com/dinghanhua/p/9900775.html