1) What is the purpose of the if statement in Python control flow? a) To define a function or method. b) To execute a block of code only if a specified condition is true. c) To loop over a sequence of items. d) To execute a block of code repeatedly while a condition is true. 2) Which keyword is used to provide an alternative condition to check, only if the preceding if statement(s) evaluated to False? a) except b) elif c) fallback d) else if 3) Consider the following code script:  a) B b) C c) A and B d) A 4) Which control flow keyword is considered the 'default' or 'catch-all' block that executes only if all previous conditions are False? a) elif b) else c) finally d) default 5) What is a required characteristic of the condition used in an if or elif statement? a) It must contain a variable assignment. b) It must be a complex expression involving at least two variables. c) It must be enclosed in parentheses. d) It must be a boolean expression that evaluates to either True or False.

per en/la

Tauler de classificació

Estil visual

Opcions

Canvia de fonament

Restaurar desada automàtica: ?