Write a Python function that creates a coroutine maintaining a running total. The coroutine must accept numerical values from outside through its send method, add each received value to the total beginning at 0, and print the updated total after every input.
A suitable function signature is:
def cumulative_sum_coroutine():
...
yield.close() so it can be terminated.3; it should print the current total, 3.5 next; it should print the updated total, 8.Input:
3
5
Output:
3
8
The first value establishes a cumulative total of 3, and adding the second value produces a total of 8.