Beginner question: difference between lists and tuples

K

KDawg44

Hi,

I am trying to learn python. I am working through a tutorial on
python.org. I am trying to figure out how lists are different than
tuples other than changing values at specific indices. How are these
different from arrays in other languages such as php?

THanks.
 
J

Jim

I am trying to learn python. I am working through a tutorial on
python.org. I am trying to figure out how lists are different than
tuples other than changing values at specific indices.
You can change lists but not tuples. That has some advantages, as
when you append to a list. But it has some disadvantages, as here
where I can't use a list as the key in a hash.
Traceback (most recent call last):

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top