Week 7 Flashcards

1
Q

What are loops?

A

Loops have iteration variables that change each time through the loop. Often they gi through a sequence of numbers.

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

What is an infinite loop?

A

n = 5

WHILE N > 0

print 2Lather”

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

What does the break statement do?

A

it breaks out of the loop

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

What does the continue statement do?

A

The continue statements ends the current iteration and jumps to the top of the loop and starts the next iteration

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

How can you construct definite loops?

A

We can write a loop once for each of the items in a set using the Python for construct. These loops are called definite loops

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

How do you find the largest so far value

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