Resume and restart numbered readings

A laboratory records four sample volumes in millilitres (mL). In Python 3, next(numbered) retrieves and consumes the next counter–value pair from the existing enumerate object.


Python
readings = [14, 18, 22, 26]
numbered = enumerate(readings, start=50)

next(numbered)
next(numbered)

remaining_total = 0
for label, value in numbered:
    remaining_total += value
last_label = label

reused_count = 0
for label, value in numbered:
    reused_count += 1

fresh_first_label, fresh_first_value = next(
    enumerate(readings, start=50)
)


Find the final values of remaining_total in mL, last_label, reused_count, and fresh_first_label. Enter all four answers as exact integers.

Your answers

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: