Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_nested_list(input):
- """Prints out every single string in input, one per line."""
- if type(input) is list
- for item in input
- print_nested_list(['cs1110'])
- print_nested_list(['this', ['is', 'a'], 'list', ['list', 'list' ]])
- print_nested_list([[['cs1110', 'opython'], 'nested'], 'recursion', 'test'])
- cs1110
- opython
- nested
- recursion
- test
- def print_nested_list(input_list):
- if type(input_list) is list:
- for item in input_list:
- print_nested_list(item)
- else:
- print input_list
- mylist = [[['cs1110', 'opython'], 'nested'], 'recursion', 'test']
- print_nested_list(mylist)
- cs1110
- opython
- nested
- recursion
- test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement