Complete the function
# yield a running total
def running(nums):
t = 0
for n in nums:
t += n
____ t
Answer: yield
yield turns the function into a generator producing each running total.
Play Problem Solving ▸
# yield a running total
def running(nums):
t = 0
for n in nums:
t += n
____ t
Answer: yield