Advertisement
morty0505

Untitled

Nov 25th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. def foldr-right op initial seq:
  2. if not seq:
  3. initial
  4. else:
  5. op(seq[0],foldr-right op, initial, seq[1:])
  6.  
  7. def fold-left op z seq:
  8. if not seq:
  9. z
  10. else:
  11. fold-left op op(z, seq[0]) seq[1:])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement