What is the purpose of the 'elif' statement?
Correct answer
B. To handle multiple conditions after an 'if' statement
19 views
B. To handle multiple conditions after an 'if' statement
19 views
The 'elif' statement is used in conjunction with 'if' to handle multiple conditions in a sequence. It allows for checking additional conditions if the preceding 'if' or 'elif' statements are false.
Not sure why the answer is B? Ask here and get an explanation.