Data Types - Set Flashcards

1
Q

Which of the following can’t be sliced, and why not;

Set
Tuple

A

Set

Because, they are;
1) Not ordered
2) Not Indexable

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

What is the syntax for a set

A

{1, 2, 3}

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

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

A

To convert another data type to a Set to eliminate duplicates

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