-
-
Save IndhumathyChelliah/ecf78aedc5cdff97caed6ee54769f910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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