Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fibrec(count):
- if count <= 0:
- return None
- def actual_fibrec(counter, preprev, prev):
- if counter == 0:
- return []
- else:
- cur = preprev + prev
- return [cur] + actual_fibrec(counter, prev, cur)
- if count == 1:
- return [0]
- else:
- return [0, 1] + actual_fibrec(count - 2, 0, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement