0 out of 464 challenges solved
Write a Python function `sum_and_average(n)` that calculates the sum and average of the first `n` natural numbers. The function should return a tuple containing the sum and the average. #### Example Usage ```python [main.nopy] result = sum_and_average(10) print(result) # Output: (55, 5.5) result = sum_and_average(5) print(result) # Output: (15, 3.0) ```
def sum_and_average(n): """ Calculate the sum and average of the first n natural numbers. Args: n (int): The number of natural numbers to consider. Returns: tuple: A tuple containing the sum and the average. """ # Placeholder for the sum and average calculation pass