FOR and WHILE Loops Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does a FOR Loop do?

A

Loops a definite set amount of times (range).

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

What does the loop variable do?

A

Counts the number of times a loop repeats itself.

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

How many times would this loop the code?
for x in range (5):

A

5 times

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

Iteration definition

A

The process of repeating steps.

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

How does the use of iteration impact coding?

A

It allows us to simplify our algorithm by stating that we will repeat certain steps until told otherwise. This makes designing algorithms quicker and simpler because they don’t have to include lots of unnecessary steps.

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