Problem: Convert a Nested List into a Flat List

Problem Statement:
Write a program that takes a nested list as input and converts it into a flat list, meaning all the elements should be in a single list without any nesting.

Example:

Input

[1, [2, 3], [4, [5, 6]], 7]

Output

[1,2,3,4,5,6,7]

Hints

To check if an object is a list, you can use

if type(obj) is list

Good Luck and Happy Coding