Chained Sequences
No account is required. Learn the material, try the examples, and mark it complete locally when you are ready to move on.
Lists within a list
So far, we have discussed lists, tuples, dictionaries, sets as a sequence.
But we can chain these data types together to create say, a list within a list, list within a tuple and so on.
list1 = list(range(4))
list1[0, 1, 2, 3]list2 = ["one", "two", "three", "four"]
list2['one', 'two', 'three', 'four']We have the append method to append anything inside a list. Lets see what happens when we append a list to another list.