def calc(a,b): #a,b 是形参,在函数定义处 c=a+b return c result = calc(10,20) #按位置传递参数 #10,20 为实参,在函数调用处 print(result) res = calc(b=20,a=10) #根据形参名称进行实参传递 print(res)
E:\PycharmProjects\pythonProject\venv\Scripts\python.exe E:/PycharmProjects/pythonProject/demon1/demo24.py 30 30 进程已结束,退出代码0
标签:10,10.2,20,函数调用,pythonProject,实参,calc From: https://www.cnblogs.com/988MQ/p/16658467.html