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
0is falsey in both JS & Python? -
True or False, the number
1is 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/elsestatement must be surrounded by parenthesis? -
Instead of
!in JS we use ___ in Python. -
What does the expression
1 and 2return? -
What does the expression
1 or 2return? -
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
messagethe string'You Won'if the variablescoreis greater than 100, otherwise assign the string'Nice Try'