Program - lazy evaluation


Topic: Program - lazy evaluation

Solution

gen_succeeds = (i for i in range(5) for j in 1/0)
print('But obviously fails when we iterate ...')
for i in gen_succeeds:
    print(i)



List all Python Programs