Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created September 18, 2020 11:41
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/ecf78aedc5cdff97caed6ee54769f910 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/ecf78aedc5cdff97caed6ee54769f910 to your computer and use it in GitHub Desktop.
from itertools import starmap
num = [(1, 2), (2, 3)]
def multiply(x, y):
return x * y
m = starmap(multiply, num)
print (m)
#Output:<itertools.starmap object at 0x0326F028>
# Converting map object to list using list()
num2 = list(m)
print(num2) # Output:[2, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment