单选题
适中
#16300
运行以下Python程序,表述中错误的选项是?( ) def de(a,b): c=a*2+b b=a return c a=10 b=20 c=de(a,b)…
运行以下Python程序,表述中错误的选项是?( )
def de(a,b): c=a*2+b b=a return c a=10 b=20 c=de(a,b)+b
答案与解析
正确答案:D
解析
调用后函数返回值局部变量c为40,调用结束时程序返回到调用出,全局变量c=40+20=60。故选D。