Can someone please explain to me why there is a difference in printing my sequence generation between "with" and "without" a for loop?
def generation(x):
i = 0
while i < x:
yield i
i += 1
x = generation(10)
print("Print without for loop: " + str(x))
print("Print with for loop: ")
for j in x:
print(j)