Selection Flashcards

1
Q

Selection

A

Making choices in the flow of execution of a program

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

Selections are made on the basis of ________ expressions

A

boolean (evaluate to true or false)

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

Nested ‘if’ statement

A

If statement within an if statement

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

Dangling else problem does not apply in python because…

A

‘if’-‘else’ association is determined by indent level

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

Multiway selection

A

Multiple conditions, each of which causes a different block of statements to execute
Used when there are more than 2 options

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

Booleans

A

Binary value that has only two possible states - True or False

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

3 boolean operators

A

and, or, not

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

De Morgan’s Laws

A

Two transformation laws for simplifying expressions involving boolean algebra:
not(A or B) = not A and not B
not(A and B) = not A or not B

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

Conditional expression

A

Expression that compares values using conditional operators (< , > , == , etc.)
Evaluate to boolean

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