0 out of 464 challenges solved
Write a Python function `square_perimeter` that calculates and returns the perimeter of a square given its side length as input. The formula for the perimeter of a square is: \[ \text{Perimeter} = 4 \times \text{side length} \] #### Example Usage: ```python [main.nopy] print(square_perimeter(10)) # Output: 40 print(square_perimeter(5)) # Output: 20 print(square_perimeter(4)) # Output: 16 ``` #### Constraints: - The input will always be a positive integer or float. - The function should return the perimeter as a float or integer.
def square_perimeter(side_length): """ Calculate the perimeter of a square given its side length. Args: side_length (float): The length of one side of the square. Returns: float: The perimeter of the square. """ # Replace the following line with your implementation pass