QuestionQ190

VerifiedDevelopment and Ingestion

A data engineer only wants to execute the final block of a Python program if the Python variable day_of_week is equal to 1 and the Python variable review_period is True.

Which of the following control flow statements should the data engineer use to begin this conditionally executed code block?

Explanation

Python requires the equality operator == for comparisons, not the assignment operator =. Option D correctly uses == to compare day_of_week to 1 and checks the boolean value of review_period directly without comparing it to a string. Options A and B use the assignment operator, and B incorrectly compares a boolean to the string 'True'.

Community Discussion

No comments yet. Be the first to start the discussion!