Using Lists and Tuples in Python

0 votes
Why does Python have data structures like tuples and lists? How are these data structures used optimally?
May 29, 2018 in Python by kek

1 answer to this question.

0 votes
if you are familiar with C programming, you consider lists to be analogous to arrays in C and, tuples to be analogous to structures, in that they stores data of different types. Do remember that tuples are immutable, unlike strings. I hope this will be helpful for you in deciding which data structures to use.
answered May 29, 2018 by Nietzsche's daemon
• 4,260 points

Related Questions In Python

0 votes
1 answer

Using filter, map, and reduce in Python

A quick implementation might look like this: from ...READ MORE

answered Nov 2, 2018 in Python by Priyaj
• 57,640 points
0 votes
1 answer

Shortest path from source to and from a negative cycle using Bellman Ford in Python

class NegativeWeightFinder: def __init__(self, graph: nx.Graph): ...READ MORE

answered Nov 13, 2018 in Python by Nymeria
• 3,520 points
0 votes
3 answers
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,350 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

Copying lists in python

Assigning one list to another one simply ...READ MORE

answered Apr 30, 2018 in Python by Nietzsche's daemon
• 4,260 points
0 votes
1 answer

Using quotes in python

Both the conventions for enclosing strings are ...READ MORE

answered May 9, 2018 in Python by Nietzsche's daemon
• 4,260 points