changeset 37:5268ab85fe1b

stub a fibonacci sequence for testing
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 07 Jun 2011 19:14:04 -0700
parents 362912842985
children f6616a5f468f
files tests/objects.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/objects.py	Tue Jun 07 19:11:27 2011 -0700
+++ b/tests/objects.py	Tue Jun 07 19:14:04 2011 -0700
@@ -38,4 +38,7 @@
 
 def fib(n):
     """return the nth fibonacci term"""
-    
+    sequence = [1,1]
+    while len(sequence) < n:
+        sequence.append(sequence[len(sequence)-1], sequence[len(sequence)-2])
+    return sequence[n]