用類編寫圓

 設計一個Circle(圓)的類,包括圓心位置,半徑,顏色等屬性。編寫構造方法和其餘方法,計算周長,面積。請編寫程序驗證類的功能。python class Circle: def __init__(self,place,r,color): self.center=place self.r=r self.color=color def
相關文章
相關標籤/搜索