What is the purpose of the "if" statement in Python?
Correct answer
C. To perform conditional execution
16 views
C. To perform conditional execution
16 views
The if statement performs conditional execution: its indented block runs only when the condition is true. It can be extended with elif and else for additional branches.
Loops are created with for and while, and functions with def.
Practise more Computer Science MCQs with answers and explanations on MCQsExam.com.
Not sure why the answer is C? Ask here and get an explanation.