Free practice · numeric · medium
Practice
Trace a status counter
A loop visits ["open", "closed", "open", "open"] and adds 1 only when status == "open". What final count is reported?
Python hand trace
Follow the statements that execute, one state change at a time
- InputsRecord initial values
- PathFollow indentation and branches
- StateRecord each assignment
- CallsBind arguments and trace returns
- OutputState the final observed value
- CheckRepeat the trace independently
A reliable prediction starts with inputs, respects indentation and control flow, records assignments, and separates returned values from printed output.