Q. Write equivalent for loop for the following list comprehension:


gen = [i/2 for i in [0, 9, 21, 32]]

print (gen)


Answer =

for i in [0, 9, 21, 32]:
    gen += [i/2]
print (gen)

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post