Exam 2 Flashcards

1
Q

Iteration list

A

Variable following in

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

Iteration target

A

Variable following the in which is new

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

Loop patterns

A

Reusable code templates to solve commonly occurring problems.

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

Count

A

Count how many elements are in a list
Start with an initial value of zero and 1 to count
Count = count + 1

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

Sum

A

Add up all the numbers in a list
Start with zero and add the iteration variable
sum = sum + item

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

Accumulation

A

Combine elements into a single value (adding strings)

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

Map

A

Modify all elements of a list
A new list is formed

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

Filter

A

Remove elements from a list

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

Find

A

Get an element based on its value
found = None

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

Take

A

Remove elements past a certain point in the list
taking = True

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

Minimum/Maximum

A

Get the highest or lowest value in a list

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

!pwd

A

Print current working directory

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

!ls

A

List files in current working directory

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

!ls<path></path>

A

List files in the directory of the path

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

!cd<path></path>

A

Change the current working directory to that path

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

Opening and closing files

A

Open method
Close method

17
Q

.read() method

A

Get data from a file