$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #160

Complete the function

# yield a running total
def running(nums):
    t = 0
    for n in nums:
        t += n
        ____ t

Answer: yield (also accepted: yield, yield())

yield turns the function into a generator producing each running total.
Play Problem Solving ▸