Commits

Valentine Svensson  committed 643c5dc

Started task 4 5. Made a fibonocci generator.

  • Participants
  • Parent commits f15607f

Comments (0)

Files changed (2)

 	l = 10.
 	while l*10. < inf:
 		l *= 10.
-	return l
-
-l = machine_maximum()
+	return l
+from __future__ import division
+from allscipy import *
+
+def fib_gen(n):
+	"""Generator for the fibonacci numbers"""
+	a = [0,1]
+	for i in xrange(n):
+		if i == 0:
+			yield 1
+		a[1], a[0] = a[0] + a[1], a[1]
+		yield a[1]