Guest User

410

a guest
Jun 10th, 2018
97
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def fibrec(count):
  2.     if count <= 0:
  3.         return None
  4.  
  5.     def actual_fibrec(counter, preprev, prev):
  6.         if counter == 0:
  7.             return []
  8.         else:
  9.             cur = preprev + prev
  10.             return [cur] + actual_fibrec(counter, prev, cur)
  11.  
  12.     if count == 1:
  13.         return [0]
  14.     else:
  15.         return [0, 1] + actual_fibrec(count - 2, 0, 1)
RAW Paste Data