PI = 3.14159265453r = float(input('请输入您所求圆的半径:')) def area_of_circle(r): if r<0: return None else: return PI*r**2 s = area_of_circle(r) print(f"所求半径为{r:.2f}的圆面积为{s:.2f}")
Sign in to make a reply
Herman.