面试题答案
一键面试def gen():
total = 0
for i in range(1, 11):
yield i
total += i
return total
def processGen(gen_func):
gen_obj = gen_func()
try:
while True:
next(gen_obj)
except StopIteration as e:
print(e.value)