写一个函数，该函数接受一组数字，并返回其中的最大值和最小值。
def find_extremes(numbers):
    # TODO: Implement the function 
    pass
Here's an implementation of the function in Python:

```
def find_extremes(numbers):
    if not numbers:
        return None, None
    min_num = max_num = numbers[0]
    for num in numbers:
        if num > max_num:
            max_num = num
        if num < min_num:
            min_num = num
    return min_num, max_num
```

This function first checks if the input list is empty, in which case it returns `None` for both the minimum and maximum values. Otherwise, it initializes the starting minimum and maximum values to be the first number in the list, and then iterates through the rest of the list, updating the minimum and maximum values as necessary. Finally, it returns the minimum and maximum values as a tuple.