import math
class crilce():
def __init__(self,r):
self.r=r
def volume(self):
print(f'该圆的的体积为{math.pi*self.r**3}')
def area(self):
print(f'该圆的的面积为{math.pi*self.r**2}')
def perimeter(self):
print(f'该圆的的周长为{math.pi*self.r*2}')
a=crilce(5)
a.volume()
a.area()
a.perimeter()
设一个圆类,根据半径R求其体积、面积、周长
![](https://img-home.csdnimg.cn/images/20240711042549.png)