def 函数名(a,b):
函数体
return
#例:
def ligon(a,b):
c=a+b
return c
c=ligon(10,20)
print(c)
输出结果:
D:\python.exe C:/Users/lenovo/PycharmProjects/untitled2/tuple_list.py
30
Process finished with exit code 0
初级函数
最新推荐文章于 2024-07-16 19:26:54 发布