4.5 Flashcards

1
Q

______ (Boolean/Conditional statement) is an expression that is either true or false.

A

Boolean expression

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

______ (Boolean/Conditonal Statement) are used to have two or more outputs for a condition, with a specific action for each condition output.

A

Conditional Statement

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

If statement, Else Statement, and elif statement are all _______ statements.

A

conditional

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

Boolean expressions use the operator_____ to compare two values and produce True if they are equal and false to otherwise.

A

==

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

T or F: with an if statement, your program can make a choice.

A

True

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

an _____ statement allows you to run a group of instructions, based on a condition or set of conditions.

A

if statement

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

if statement syntax:

A
if condition:
indented statement(s)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

T or F: the eval() function evaluates the “string” like a python expression and returns the result as a statement.

A

false, as an integer.

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

the syntax of writing an if-else statement:

A

if condition:
indented statement(s)
else:
other indented statement(s)

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

we use the ____ statement in python if we have more than two possibilities for a condition.

A

elif

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

the syntax of writing an elif statement

A
if condition:
indented statement(s)
elif condition:
indented condition(s)
else:
indented statement(s)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly