Python无效的语法
def trapezoid_area(1, 2, height=3):
return 1/2 * (1+2) * heigh
你的
def trapezoid_area(1, 2, height=3):
中,1,2是画蛇添足了,用
def trapezoid_area(height=3):
就可以了,你只用到一个参数,常量不能做参数的
热门标签:
def trapezoid_area(1, 2, height=3):
return 1/2 * (1+2) * heigh
你的
def trapezoid_area(1, 2, height=3):
中,1,2是画蛇添足了,用
def trapezoid_area(height=3):
就可以了,你只用到一个参数,常量不能做参数的