03. Control Flow with Decisions and Loop - EXAM Flashcards

1
Q

Which is a characteristic of an if statement?

Select one:

a. Set to run a set number of times
b. Exits a loop and runs code
c. Run a block code based on if a condition is true or false
d. A counter controls if an if statement block will run.

A

c. Run a block code based on if a condition is true or false

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

Which best defines the purpose of an else statement?

Select one:

a. Used in case there are no if or elif statements that are false
b. Used in case there are no if or elif statements that are true
c. Used to control if and elif statements
d. Used to override if and elif statements

A

b. Used in case there are no if or elif statements that are true

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

Which best defines a for loop?

Select one:

a. A loop that is set to run a certain number of times
b. A loop that is set to run for one instance
c. A loop that is always on
d. A loop that is set to run forever
e. A loop that is set to run until an event occurs

A

a. A loop that is set to run a certain number of times

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

Nested loops are __________ inside of __________.

Select one:

a. compounds, compounds
b. compounds, loops
c. loops, compounds
d. loops, loops

A

d. loops, loops

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

Which of these words are used with compound conditional expressions? (Choose all that apply.)

Select one or more:

a. WITH
b. NOT
c. USE
d. AND
e. OR

A

b. NOT
d. AND
e. OR

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