Skip to content

Instantly share code, notes, and snippets.

@bdegley4789
Last active September 12, 2019 06:07
Show Gist options
  • Save bdegley4789/3afa3abda9f15bc88c9aac127c25f484 to your computer and use it in GitHub Desktop.
Save bdegley4789/3afa3abda9f15bc88c9aac127c25f484 to your computer and use it in GitHub Desktop.

nested_list_exercise

Creator: Bryce Egley

Run

python nested_lists.py

Test

python nested_lists_tests.py

NOTE

The flatten fuction in nested_lists.py is the function that satisfies the requirements of the exercise. I wrote tests for the flatten function as well in nested_lists_tests.py. I wrote the other functions in nested_lists.py just to see time performance with large lists and test cases like 0 or 1 sized lists. I developed the flatten list function in jupyter_nootbooks and included my notebook in the repo

Functions:

flatten

Flattens a nested listed. You may want to give this function your own custom input, besides using my nested listed generator.

build_nested_list

randomly generates a nested list of integers

input_number

gets valid input from the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment