Chapter 7 Flashcards

1
Q

Sequence

A

An object that contains multiple items of data. The items are stored in sequence, one item after the other.

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

List

A

An object that contains multiple data items

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

Element

A

An item in a list.

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

Repetition operator

A

Makes multiple copies of a list and joins them together. The * operator is a repetition operator when applied to a sequence and an integer. General format:

list * n

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

Index

A

A number specifying the position of an element in a list.

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

len() function

A

Returns the length of a sequence such as a list.

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

Concatenate

A

Join two things together.

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

Slice

A

A span of items that are taken from a sequence.

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

append(item)

A

Used to add items to a list. Item is appended to the end of the existing list.

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

index(item)

A

Used to determine where an item is located in a list. Returns the index of the first element in the list containing item.

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

insert(index, item)

A

Used to insert item at position index in the list.

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

sort():

A

Used to sort the elements of the list in ascending order.

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

remove(item)

A

Removes the first occurrence of item in the list.

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

reverse()

A

Reverses the order of the elements in the list.

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

del statement

A

Removes an element from a specific index in a list. General format:

del list[i]

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

min and max functions

A

Built-in functions that return the values that have the lowest or highest values in a sequence.

17
Q

Tuple

A

An immutable sequence.

18
Q

list() function

A

Converts a tuple to a list.

19
Q

tuple() function

A

Converts a list to a tuple.