publish solutions

This commit is contained in:
2025-02-17 16:52:06 +01:00
parent e4fc3e18b1
commit 64b8207dbb
12 changed files with 197 additions and 17 deletions

View File

@@ -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)