All pastes #1469652 Raw Edit

Object Fibbonachi. Python/Jython

public python v1 · immutable
#1469652 ·published 2009-06-22 09:32 UTC
rendered paste body
import timeclass Fib:	def __init__(self, n):		self._value = n	def value(self):		if(self._value <= 2):			return 1		f1 = Fib(self._value - 1)		f2 = Fib(self._value - 2)		return f1.value() + f2.value()st = int(time.time())print Fib(40).value()en = int(time.time())print "Time :", en-st