4.5 Flashcards
______ (Boolean/Conditional statement) is an expression that is either true or false.
Boolean expression
______ (Boolean/Conditonal Statement) are used to have two or more outputs for a condition, with a specific action for each condition output.
Conditional Statement
If statement, Else Statement, and elif statement are all _______ statements.
conditional
Boolean expressions use the operator_____ to compare two values and produce True if they are equal and false to otherwise.
==
T or F: with an if statement, your program can make a choice.
True
an _____ statement allows you to run a group of instructions, based on a condition or set of conditions.
if statement
if statement syntax:
if condition: indented statement(s)
T or F: the eval() function evaluates the “string” like a python expression and returns the result as a statement.
false, as an integer.
the syntax of writing an if-else statement:
if condition:
indented statement(s)
else:
other indented statement(s)
we use the ____ statement in python if we have more than two possibilities for a condition.
elif
the syntax of writing an elif statement
if condition: indented statement(s) elif condition: indented condition(s) else: indented statement(s)