Flow control Flashcards
What is “Flow control”
Flow control statements can decide which Python instructions to execute under which conditions.
What is the Boolean Value?
True or False and they always start with a capital T and F
When do you get error while using boolean values?
➊. If you don’t use the proper case
➋ or you try to use True and False for variable names
what do comparison operators do?
compare two values and evaluate down to a single Boolean value.
What is the other name of comparison operators?
relational operators,
What is the comparison operators for
“Equal to”
==
What is the comparison operators for
Not equal to
!=
What is the comparison operators for
Less than
What is the comparison operators for
Greater than
>
What is the comparison operators for
Less than or equal to
<=
What is the comparison operators for
Greater than or equal to
> =
What is the output of 42 == ‘42’ ? Why?
False, because and int or float are not equal to string
what is the output of 42 == 42.0?
True
what is the name and difference of == and =
The == operator (equal to) asks whether two values are the same as each other.
The = operator (assignment) puts the value on the right into the variable on the left.
What are the Boolean Operators?
and
or
no
Why are the and and or binary operators?
The and and or operators always take two Boolean values (or expressions), so they’re considered binary operators.
The and and or Operator’s Truth Table: True and True ? True and False ? False and True ? False and False ? True or True ? True or False ? False or True ? False or False ?
True False False False True True True False