Created
February 14, 2025 13:38
-
-
Save RobertTalbert/8344fe0655c86e914cf069aa37c64816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten_list(lst): | |
flattened = [] | |
for item in lst: | |
if isinstance(item, list): | |
flattened.extend(flatten_list(item)) | |
else: | |
flattened.append(item) | |
return flattened |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment