A list of lists: nested list
words = 'The quick brown fox jumps over the lazy dog'.split() print words stuff = [[w.upper(), w.lower(), len(w)] for w in words] for i in stuff: print i stuff = map(lambda w: [w.upper(), w.lower(), len(w)], words) for i in stuff: print i
1. | Demonstrates nested sequences | ||
2. | Nest lists (create lists containing other lists) |