Explore Library
Code Quiz

Reusing a Generator Expression

Spot why iterating a generator expression a second time misbehaves.

Codepython
def scores_report(raw):
    scores = (int(x) for x in raw)
    total = sum(scores)
    top = max(scores)
    return total, top

print(scores_report(["90", "75", "88"]))

What is the bug in this code?