This commit is contained in:
mike
2026-06-18 00:06:15 +02:00
parent 2d0322465d
commit 1dead1c666
32 changed files with 3332 additions and 65 deletions

23
example.py Normal file
View File

@@ -0,0 +1,23 @@
def calculate_area(length, width):
"""
Calculate the area of a rectangle.
Args:
length (float): The length of the rectangle
width (float): The width of the rectangle
Returns:
float: The area of the rectangle
"""
if length <= 0 or width <= 0:
raise ValueError("Length and width must be positive numbers")
return length * width
# Example usage
if __name__ == "__main__":
try:
area = calculate_area(5, 3)
print(f"The area is: {area}")
except ValueError as e:
print(f"Error: {e}")