Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created Jul 5, 2020
Embed
What would you like to do?
import itertools
#It will return square of numbers from 0 to 9.
l1=map(pow,range(10),itertools.repeat(2))
print(l1)#Output:<map object at 0x011CEC10>
#iterate through map object using for loop
for i in l1:
print (i,end=" ") #Output:0 1 4 9 16 25 36 49 64 81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment