def gen(n):
    for i in range(n):
        print('hui')
        yield i

test = gen(10)
for n in test:
    print(n)

test = gen(10)
print(list(test))