Szabolcs <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> 
> I was wondering about why are there both tuples and lists? Is
> there anything I can do with a tuple that I cannot do with a
> list? 
> 
> In what circumstances is it advantageous to use tuples instead
> of lists? Is there a difference in performance?
> 
> I am still learning Python, so please be gentle ...
> 
This topic comes up from time to time in this newsgroup. If you want 
a lot of viewpoints about it, Google is your friend. 

A short answer, though: tuples can be used as dictionary keys and 
lists cannot. I would guess (but would have to test to confirm) that 
tuples occupy less space for the same data. I don't know whether any 
differences in, say, iteration speed would be terribly significant, 
but I would expect tuples to be marginally faster. 

-- 
rzed
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to