<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_rewards(self, scores):
 """Retain the K most recent scores, and replace the rest with zeros"""

        for i in range(len(scores)):
            if i >= self.k:
                scores[i] = 0.
        return scores