Question Detail
Question
In the 'ATM Security Check' example on page 6, the
while loop condition is while pin != "1234":. What is the intended behavior of this loop?
Correct Answer
Option B is the correct answer.
Detailed Explanation
The text states, 'Wait for the user to provide the correct PIN before granting access.' and 'This loop runs forever until the correct PIN is entered.' The condition
pin != "1234" means the loop continues as long as the input PIN is not '1234'.
Hint
The '!=' operator means 'not equal to'. The loop continues as long as the condition is true.