tuple or list?

Thread Solved

Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

tuple or list?

 
0
  #1
Jun 16th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,002
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 927
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: tuple or list?

 
0
  #2
Jun 16th, 2005
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.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC