CH4 - Working With Lists Flashcards

1
Q

What is a For Loop?

A

A For Loop allows you to take action or set of actions with all elements in a list.

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

What is the most common way to automate repetitive tasks?

A

For Loop.

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

Will a For Loop create a Temp variable?

A

Yes.

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

Will the For Loop statement continue until the last element in a list?

A

Yes.

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

The symbol for the end of For Loop?

A

Colon = :

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

What does a colon: at the end of the statement mean?

A

To expect a loop.

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

What is a range()

A

Python function counts every digit in the list.

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

What is a list()

A

Python function used to create a list.

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

When should code be indented?

A

After the For Loop statement.

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

What is a min()

A

Python function. Finds the minimal digit in a list.

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

What is a max()

A

Python function. Finds the maximal digit in a list.

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

What is a sum()

A

Python function. Finds the sum of numbers in a list.

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

What is a slice?

A

Works with a specific group of elements within a list.

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

What is slicing?

A

Specify the index position of the 1st & last element on a list. EXP: [0:3]

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

What is a tuple?

A

An immutable list.

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

Tuple symbol?

A

Parentheses ()

17
Q

What is PEP?

A

Python enhancement proposal.

18
Q

Indentation?

A

4 spaces recommended.

19
Q

LIne length?

A

80 characters.

20
Q

Comment length?

A

72 characters.

21
Q

Blank lines?

A

Used between blocks of code.