Data Structures Flashcards

Learn about data structures in Python

1
Q

Built-in data structures?

A
  1. List
  2. Tuple
  3. Dictionary
  4. Set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Mutable built-in data structures?

A
  1. List
  2. Dictionary
  3. Set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Are classes mutable?

A

Yes (default)

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

What is a mutable object?

A

Object that can change its state or contents

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

Classes in collections module?

A
  1. namedtuple
  2. deque
  3. Counter
  4. OrderedDict
  5. defaultdict
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

deque constructor

A

deque([iterable[, maxlen]])

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

Create tuple with new item on end

A

tup + (item, )

*tup, item

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