Coverage for src / area.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-19 22:28 +0000

1def calculate_area_square(length: int | float) -> int | float: 

2 """ 

3 Function to calculate the area of a square 

4 :param length: length of the square 

5 :return: area of the square 

6 """ 

7 if not isinstance(length, (int, float)) or length <= 0: 

8 raise TypeError("Length must be a positive non-zero number") 

9 return length * length