Discuss / Python / 作业

作业

Topic source

beyond_24th

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

import math

def areaOfCirce(r):

if r <=0:

print('输入错误!')

else:

S = math.pi*r**2

return S

r = float(input("输入圆的半径:"))

S = areaOfCirce(r)

print(f"圆的面积是 {S:.2f}")


  • 1

Reply