所有的程序员都是编剧,所有的计算机都是烂演员。   
返回顶部

Python——函数 3、实参与形参

 

实参:函数调用时候的参数值
形参:是函数定义时候定义的参数名
def my_max(a,b): # a,b为形参
    '''
    比较两个数之间大小
    '''
    if a>b:
        return a
    else:
        return b
i=my_max(10,30)   #10,30为实参
print(i)
View Code

 

posted @ 2018-04-18 18:15  steven丶syw  阅读(259)  评论(0编辑  收藏  举报