Tuple Flashcards

1
Q

What is a tuple?

A

a tuple is like a list but it is IMMUTABLE and uses parentheses. You can’t sort it or reverse it or modify it

my_tuple = (1, 2, 3, 4, 5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the benefits of a tuple?

A

it makes code more predictable as you know it will not change
it communicates to others that the code will not change
it is more secure
faster than lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly