+ Register to Reply
Results 1 to 8 of 8

Thread: what's the difference between Lists and Tuples in python . and which one is - Unix / Linux Games Chat (View Game Forum)

  1. #1

    Feed what's the difference between Lists and Tuples in python . and which one is

    UNIX: what's the difference between Lists and Tuples in python .

    and which one is used mostly in py scripts to store different types of objects. ??

  2. #2
    A tuple is a fixed-size "list", while a list can change its size. You use tuples to force the required size of a list, if you need to return or pass multiple variables to a function.

  3. #3
    it's only mutable against non mutable.

  4. #4
    Tuples are immutable unlike lists.
    However, tuples are not just "constant" lists -- this is a common misconception. Lists are intended to be homogeneous sequences, while tuples are hetereogeneous data structures.

  5. #5
    Tuples are immutable and lists are mutable.

    >>> tuple = 123, 'abc'

    Trying to change the value of a tuple will throw an exception.

    >>> list = [123, 'abc']

    You can change the values of lists.

  6. #6
    I use lists for storing different types of objects.

  7. #7
    Is this a UNIX page?

  8. #8
    Lists are dinamic and tuples are size fixed

+ Register to Reply

Similar Threads

  1. Its the time to play with shell / perl / python
    By Alienz15 in forum Unix / Linux Games Chat
    Replies: 0
    Last Post: 04-13-2013, 08:10 PM
  2. Question time: In the small python snippet below: ---------------
    By King of Ice in forum Unix / Linux Games Chat
    Replies: 15
    Last Post: 04-01-2013, 08:52 AM
  3. Urban Rivals Python Card
    By Harley Quinn in forum Urban Rivals
    Replies: 0
    Last Post: 11-07-2012, 10:42 AM
  4. Zombie Jombie Python+
    By Aeron in forum Zombie Jombie Wiki & Guide
    Replies: 0
    Last Post: 07-10-2012, 05:46 PM
  5. Zombie Jombie Python
    By Aeron in forum Zombie Jombie Wiki & Guide
    Replies: 0
    Last Post: 07-10-2012, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •