Discuss / Python / 打卡第二天

打卡第二天

Topic source

皆由唧唧

#1 Created at ... [Delete] [Delete and Lock User]

作业是计算圆的面积?

def area_circle(r):
    s=3.14*r**2
    return s
r=float(input('Enter radius of circle: '))
print('%.2f' % area_circle(r))

Muretto

#2 Created at ... [Delete] [Delete and Lock User]

请问这段代码怎么解释呢?

return s

这里用了定义函数功能:参考def百度

函数分类:有参数,有返回值函数


  • 1

Reply