python返回两个值 python函数可以有多个返回值?

python函数可以有多个返回值?这种反向排序的示例是多个值def get ugitpath():gitpaths=[]gitpath=请求.args.get(“c”,0,type=str)f=ope

python函数可以有多个返回值?

这种反向排序的示例是多个值

def get ugitpath():

gitpaths=[

]gitpath=请求.args.get(“c”,0,type=str)

f=open(系统路径[0] " gitpath.txt文件“,”r“)

lines=f.readlines()

对于行中的行:

line=线条.strip(“n”)gitpaths.append文件(线路)返回路径

1。在Python函数或类的方法中,使用return返回值,退出函数,返回调用并继续。

2. Python有一个特殊的语法generator,不返回,带有yield或yield from返回值。