0 out of 464 challenges solved

Flatten Nested List

Write a function `flatten_list` that takes a nested list as input and returns a flattened version of the list. The function should handle lists of arbitrary depth.

#### Example Usage
```python [main.nopy]
flatten_list([1, [2, [3, 4], 5], 6])
# Output: [1, 2, 3, 4, 5, 6]

flatten_list([[10, 20], [30, [40, 50]], 60])
# Output: [10, 20, 30, 40, 50, 60]

flatten_list([])
# Output: []
```
def flatten_list(nested_list):
    """
    Flattens a nested list into a single list.

    Args:
        nested_list (list): A list that may contain other lists as elements.

    Returns:
        list: A flattened list containing all elements from the nested structure.
    """
    # Placeholder for the solution
    pass