Python Intro / Control Flow Review Questions:
-
Instead of using code blocks delimited with curly braces, Python uses i_________.
-
The line preceding an indented block of code must end with a _ character.
-
True or False, the number
0
is falsey in both JS & Python? -
True or False, the number
1
is truthy in both JS & Python? -
True or False, an empty array in JS (
[]
) and an empty list in Python ([]
) are both truthy? -
True or False, conditional expressions in an
if
/elif
/else
statement must be surrounded by parenthesis? -
Instead of
!
in JS we use ___ in Python. -
What does the expression
1 and 2
return? -
What does the expression
1 or 2
return? -
True or False,
f'5 + 10 equals {5 + 10}'
, is a valid formatted string literal (AKA F-string)? -
Write the Python single-line ternary statement that assigns to a variable named
message
the string'You Won'
if the variablescore
is greater than 100, otherwise assign the string'Nice Try'