class Rectangle():
“”"
用类求矩形的面积
“”"
def init(self,length,width):
self.length=length
self.width=width
def Area(self):
area=self.length*self.width
return area
r=Rectangle(20,12)
a=r.Area()
print(a)
class Rectangle():
“”"
用类求矩形的面积
“”"
def init(self,length,width):
self.length=length
self.width=width
def Area(self):
area=self.length*self.width
return area
r=Rectangle(20,12)
a=r.Area()
print(a)