944,103 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 2765
  • Python RSS
Jun 16th, 2005
0

tuple or list?

Expand Post »
from my understanding, a list can do everything a tuple can do plus more. The big advantage of using a list is you can change elements, lists are mutable. Are their situations where a tuple is preferable to a list?
Similar Threads
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Jun 16th, 2005
0

Re: tuple or list?

Tuples are handy for transferring multiple data, for instance to and from a function. They are easy to construct and transfer and assign their data easily. Check the multiReturn() example in the "Starting Python" sticky to see what I mean.
Moderator
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: while loop question
Next Thread in Python Forum Timeline: Python and Unicode





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC