publish solutions
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
class Rectangle:
|
||||
def __init__(self, width, length):
|
||||
self.width = width
|
||||
self.length = length
|
||||
|
||||
def calculate_area(self):
|
||||
return self.width * self.length
|
||||
|
||||
def calculate_perimeter(self):
|
||||
return 2 * (self.width + self.length)
|
||||
|
||||
|
||||
# Test de la classe Rectangle
|
||||
rectangle = Rectangle(5, 3) # 5:width & 3:length
|
||||
print("Largeur:", rectangle.width)
|
||||
|
||||
Reference in New Issue
Block a user