lists and tuples Flashcards

1
Q

this term refers to an individual item in a list

A

element

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

this is a number that identifies an item in a list

A

index

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

this is the first index in a list

A

0

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

this will happen when you try to use and index that is out of range for a list

A

an IndexError exception will occur

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

this function returns the length of a list

A

len

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

when the * operator’s left operand is a list and its right operand is an integer, the operator becomes…

A

the repetition operator

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

this list method adds an item to the end of an existing list

A

append

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

if you call the index method to locate an item in a list and the item is not found, this happens…

A

a ValueError exception is raised

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

this built in function returns the highest value in a list

A

max

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

this file object method returns a list containing the file’s contents

A

readlines

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

what is a list?

A

an object that contains multiple data items

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

what are the items stored in the list called?

A

elements

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