[] vs. ()

Michal Bozon bozon at natur.cuni.cz
Tue Mar 14 08:03:37 EST 2000


__Hi__
Could anyone tell me the difference between tuples and lists? (except from
that a list has few methods (append, extend, remove...) and tuple
doesn't.)

>>> l = [1, 2, 3]
>>> t = (1, 2, 3)
>>> l[0]
1
>>> t[0]
1

Thanks,

Michal Bozon
Faculty of Science, Charles Univ., Prague, Czech Rep.
bozon at natur.cuni.cz
http://www.natur.cuni.cz/~bozon




More information about the Python-list mailing list