Selection Flashcards

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

What are selection blocks all about?

A

Making decisions

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

What are the 3 building blocks of programming?

A

Sequence, Selection and Iteration.

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

What do you need after an ‘IF’ line?

A

Colon

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

What is an indent?

A

The code in a selection block is indented, so you use tab to move the code over.

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

When is an ‘IF’ block activated?

A

When a condition is true.

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

What is a common structure for an ‘IF’ statement?

A

If/Else or If/Elif/Else or If/Then/Else.

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

What is another common structure for an ‘IF’ statement?

A

If/Else or If/Elif/Else or If/Then/Else.

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

What is another common structure for an ‘IF’ statement?

A

If/Else or If/Elif/Else or If/Then/Else.

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

What happens when an ‘IF’ statement is false?

A

Nothing unless there is an else or elif which navigates the code elsewhere.

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

Is an ‘IF’ statement just for one statement?

A

No, an ‘IF’ statement can be used to see if multiple expressions are true or not.

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

What do ELSE - IF statements check until?

A

One statement is true.

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

Other than checking if a statement is true or false, what else can an if statement check for?

A

If a variable is equal to a certain value.

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

What do nested if statements allow?

A

Multiple outputs.

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

What is nesting?

A

Embedding code within other code.

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