Program - Generators are consumed


Topic: Program - Generators are consumed

Solution

gen = (i for i in range(5))
print('2 in gen,', 2 in gen)
print('3 in gen,', 3 in gen)
print('1 in gen,', 1 in gen) 



List all Python Programs