Advertisement
rfmonk

itertools_starmap.py

Jan 16th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. from itertools import *
  5.  
  6. values = [(0, 5), (1, 6), (2, 7), (3, 8), (4, 9)]
  7. for i in starmap(lambda x, y: (x, y, x * y), values):
  8.     print '%d * %d = %d' % i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement