Track labels through skipped packages

A quality-control script uses Python 3 to assign labels to five inspected packages. The continue statement skips the remaining statements in the current iteration.


Python
scans = ["PASS", "RECHECK", "PASS", "PASS", "RECHECK"]

for label, status in enumerate(scans, start=21):
    if status == "RECHECK":
        continue
    print(label)


Complete the table with the three printed labels in order and the value stored in label immediately after the loop finishes. Enter exact integers.

Requested valueLabel
First printed label
Second printed label
Third printed label
Value stored after the loop

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More enumerate Questions: