movies = ["The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91, ["Graham Chapman", ["Michael Palin", "John Cleese", "Terry Gilliam", "Eric Idle", "Terry Jones"]]] #print(movies) #for each in movies: # if isinstance(each, list): # for item in each: # if isinstance(item, list): # for supporters in item: # print(supporters), # else: # print(item) # else: # print(each) def print_lol(the_list): for stuff in the_list: if isinstance(stuff, list): print_lol(stuff) else: print(stuff) print_lol(movies)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question