Lists make perfect sense to me as I'm familiar with arrays,
but tuples are a different story. They seem to be some kind
of "constant" array which can't be modified once created
(can't replace, delete or append new elements).
Why would you use such an inflexible data structure,
when a flexible list is available??
Disclaimer:
I'm just a Python newbie![]()
Returning multiple values from a function?
Thanks for the reply!!
I certainly understand inserting multiple values
(which might be returned from a function),
into a tuple, but once the tuple is created
it can't be modified.
Those same values can be inserted into a list with
the flexibility of deleting or appending values.
I'm new to Python, so I'm probably posting before
I have a full understanding of what the tuple and list
are much less how to use them.
Both the tuple and list do look interesting as you can
store different "data types" in them which you can't
do with arrays.
Python does seem to be worth learning.
I think this explains it best, and why you'd want to use a tuple instead of a list.
Wow I changed my sig!
Thanks,
Excellent link, it's good to know
others are asking the same question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks