Created
October 27, 2020 11:37
-
-
Save Kush1101/33a0a2fe4a13fa3c367eaceb5df09cc9 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 | |
from operator import add, mul | |
iterable = [(1,3), (2,4), (3,0), (5,6)] | |
for i in starmap(add, iterable): | |
print(i, end = ' ') | |
# 4 6 3 11 | |
for i in starmap(mul, iterable): | |
print(i, end = ' ') | |
# 3 8 0 30 | |
for i in starmap(min, iterable): | |
print(i, end = ' ') | |
# 1 2 0 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment