Lists and Tuples

0 votes
What is the difference between lists and tuples in python? Where should they be used?
Jul 2, 2018 in Python by emerald
30 views

2 answers to this question.

0 votes
answered Jul 2, 2018 by Nietzsche's daemon
• 4,260 points
0 votes
  • Lists are mutable homogeneous sequences whereas tuples are immutable heterogeneous data structures.
  • Tuples are sequences of different kinds of elements and you deal with the tuple as a coherent unit.
  • Lists are sequences of the same kind of elements, and you deal with the items individually.
  • Tuples have structure, lists have order.
answered Jul 16, 2018 by Mrunal
• 680 points

Related Questions In Python

0 votes
1 answer

Difference between del, remove and pop on lists

es, remove removes the first matching value, ...READ MORE

answered Aug 1, 2018 in Python by Priyaj
• 56,540 points
28 views
0 votes
1 answer

difference between lists and sets

There are a lot more differences such ...READ MORE

answered Jan 7 in Python by SDeb
• 13,160 points
17 views
0 votes
2 answers

What is the difference between python lists and arrays?

Python arrays and lists have the same ...READ MORE

answered Jun 10 in Python by Nisa
• 1,090 points
51 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 235 views
+4 votes
6 answers
0 votes
1 answer

Using Lists and Tuples in Python

if you are familiar with C programming, ...READ MORE

answered May 29, 2018 in Python by Nietzsche's daemon
• 4,260 points
71 views
0 votes
1 answer

Iterating over multiple lists

import itertools for item in itertools.chain(listone, listtwo): #lis ...READ MORE

answered Apr 25, 2018 in Python by Nietzsche's daemon
• 4,260 points
26 views