Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Created October 27, 2020 11:37
Embed
What would you like to do?
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