Data Types - Tuple Flashcards

1
Q

What is the syntax for a Tuple

A

(1, 2, 3)

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

What’s the most likely reason to specifically use a Tuple

A

You want to store data that will not be accidentally changed

Because it’s immutable

A String is also immutable, yet, unlike strings which can only take characters, a Tuple can take ANY data type, AND clearly seperate them with a comma.

It also helps that a Tuple executes faster & uses less memory.

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