"""
Recommended Python Style Guide:
https://peps.python.org/pep-0008/#introduction
"""


def recursive_max(n, array):
    """
    Recursively finds the maximum element in the list 'array' up to index 'n'.

    Parameters:
    n (int): The number of elements to consider from the start of 'array'.
    array (list): The list of elements in which the maximum is to be found.

    Returns:
    int: The maximum element in the list up to the n-th position.
    """
    # Base case: if n is 1, return the first element, as it's the only element to consider
    if n == 1:
        return array[0]
    else:
        # Recursive case: Compare the last element in the subarray with the maximum
        # of the rest of the list (up to the n-1 element)
        previous_max = recursive_max(n - 1, array)
        return array[n - 1] if array[n - 1] > previous_max else previous_max


# Sample list of numbers
tab = [3, 6, 12, 1, 34, -3, 21, 8, 22, -13]

# Output the maximum element in the list
print(f"The maximum element of {tab} is {recursive_max(len(tab), tab)}")
