Advertisement
roman_gemini

Untitled

Jun 10th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. mul = lambda x: x << 1  # x * 2
  2. div = lambda x: x >> 1  # x / 2
  3.  
  4. f = lambda *a: map(lambda (x, y): (mul if x < div(len(a)) else div)(y), enumerate(a))
  5.  
  6. print(f(2, 4, 6, 8, 20, 40, 60, 80))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement