Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def foldr-right op initial seq:
- if not seq:
- initial
- else:
- op(seq[0],foldr-right op, initial, seq[1:])
- def fold-left op z seq:
- if not seq:
- z
- else:
- fold-left op op(z, seq[0]) seq[1:])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement