[Solved] Python. List comprehension. List in the list and so on [closed]


def f(x):
    if x == 1:
        return []
    return [f(x-1)]

print(f(5))

Output:

[[[[[[]]]]]]

1

solved Python. List comprehension. List in the list and so on [closed]