
Explanation:
The correct answer checks if isValid equals 1 (using the == comparison operator) and if isRunnable is True (in Python, a variable that is True can be checked directly in a condition without comparing it to True). The logical operator and is used to ensure both conditions must be true for the block of code to execute.
Ultimate access to all questions.
Which Python control flow statement correctly executes a block of code only when the variable isValid is 1 and the variable isRunnable is True?
A
if isValid = 1 and isRunnable = True:
B
if isValid == 1 and isRunnable:
C
if isValid == 1 and isRunnable = "True":
D
if isValid = 1 and isRunnable:
E
if isValid == 1 && isRunnable = True:
No comments yet.