教程集 www.jiaochengji.com
教程集 >  Python编程  >  Python入门  >  正文 python里怎么调用函数

python里怎么调用函数

发布时间:2021-03-10   编辑:jiaochengji.com
教程集为您提供python里怎么调用函数等资源,欢迎您收藏本站,我们将为您提供最新的python里怎么调用函数资源

python里调用函数的方法:

如果调用无参函数,直接使用“函数名()”语句即可调用函数,如果调用有参函数,使用“函数名(参数)”语句调用即可

示例如下:

调用无参函数:

def sz():
    lista = [12, 25, 36, 48, 99]
    return lista
print(sz())

执行结果:

微信截图_20200610095214.jpg

调用有参函数:

def sz(lista):
    return lista
lista = [12, 25, 36, 48, 99]
print(sz(lista))

执行结果:

微信截图_20200610095214.jpg

更多Python知识,请关注:Python自学网!!

您可能感兴趣的文章:
python里怎么调用函数
python定义的类怎么用
python lambda怎么用
python里怎么定义
python怎么调用js中的函数
function python怎么用
python 怎么调用js
python怎么设置静态变量
python闭包有什么用
一步步教你理解Python装饰器

[关闭]
~ ~