When the Division Actually Happens
data = [1, 0, 2]
lst = [10 / x for x in data]
gen = (10 / x for x in data)
print("created gen, no error yet")
list(gen)
Treat these as two separate runs of the same script. What happens in each?
Sign in to answer questions and track your progress
Sign In