6 函数调用1

def pt_line(c,times):     #形参
    print(c*times)

times=5
char="*"

row=0

while row<5:
    pt_line(char,times)  # char ,times 实参
    row+=1

 

循环里面的pt_line 执行时,传递参数进入第一行执行,执行完,返回循环

posted @ 2020-06-08 02:43  abel2020  阅读(87)  评论(0编辑  收藏  举报