Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def printList(littleList, depth = 0):
- for a in littleList:
- if isinstance(a, list):
- depth += 1
- printList(a, depth)
- else:
- print(str(depth) +'.' + str(a))
- blah = [0, 2, 3, 4, 5, ['Jorge', ['Armando']]]
- printList(blah)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement