def area_of_circle(x): #定义函数 s=3.14(x*2) print ('%.4f'%s) return s L=[12.34,9.08,73.1] #list 存储半径值 a=int(len(L)) t=a while a>0: area_of_circle(L[t-a])#调用函数 a=a-1
s=3.14(x*2) 这里x后面是两个 号 不知道为什么有个* 没显示出来
Sign in to make a reply
emilyhyj
-- coding: utf-8 --
def area_of_circle(x): #定义函数 s=3.14(x*2) print ('%.4f'%s) return s L=[12.34,9.08,73.1] #list 存储半径值 a=int(len(L)) t=a while a>0: area_of_circle(L[t-a])#调用函数 a=a-1