Explore Library
Code QuizIntermediate

Reward vs Return Distinction

Spot why this 'return' function only reports a single reward.

Codepython
def episode_return(rewards):
    # total return over the episode
    total = 0
    for r in rewards:
        total = r
    return total

What is the bug in this episode return computation?