I want to generate something like that in a function that receives 1 argument n
using yield
to generate:
1
1+2
1+2+3
…
…
1+2+3+⋯+n−1+n
That is my last try:
def suite(n):
total = 0
for i in n:
total+=i
yield total
and this is what I receive:
Traceback (most recent call last):
File "notebook", line 4, in suite
TypeError: 'int' object is not iterable