""Suppose you have 2 lists that you want to join together. You havent been shown a purposely built way to do
that yet. You can't use append to take one sequence and add it to another. Instead, you will find
that you have layered a sequence into your list.

>>>living_room = ("rug", "table", "chair", "TV", "dustbin", "shelf")
>>>apartment = []
>>>apartment.append(living_room)
>>>apartment
[('rug', 'chair', 'table', 'TV', 'dustbin', 'shelf')]

This is probably not what you want if you were intending to create a list from the contents of the tuple
living_room that could be used to create a list of all the items in the 'apartment'.

To copy all of the elements of a sequence, instead of using append, you can use the extend method of lists
and tuples, which takes each element of the sequence you give it and inserts those elements into
the list from which it is called.

>>>apartment = []
>>>aparement.extend(living_room)
>>>apartment
['rug', 'chair', 'table', 'TV', 'dustbin', 'shelf']
Site hosted by Angelfire.com: Build your free website today!