Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 5, 2020 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/7039a67b3e41d1af3dfcf77182780ca4 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/7039a67b3e41d1af3dfcf77182780ca4 to your computer and use it in GitHub Desktop.
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