Talk:Python Programming/Tuples

tuple(1)
In this section:

I tried running the same code in a Python 2.7.6 interpreter and typing  gives the error message: Traceback (most recent call last): File "", line 1, in    tuple(1) TypeError: 'int' object is not iterable

I am no python expert so my question is: What is tuple(1) supposed to do? In your example how does it guess that it is the tuple t? Why doesn't it work when I put the same code in my own Python 2.7.6 interpreter?

Answer: It is the letter l. tuple(l) makes a tuple out of the elements in the list l.

New question: It seems that tuples are not immutable. Any good explanations ??? --Kieslich (discuss • contribs) 14:46, 30 May 2014 (UTC)
 * I think you are misinterpreting the result of your last command. It has changed the list 'list' only.
 * Tuple 'tub' stays unchanged. It contains the identical number and list instances.
 * As example, imagine you have a sticky note on your desktop containing 2 addresses.
 * The owner of the house at address 1 can build an additional garage without changing your sticky note.
 * --141.53.36.37 (discuss) Mappo