diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-27 07:44:15 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-27 07:44:15 +0000 |
commit | a70fe334476bd09b42bff8ee8622b900ab326993 (patch) | |
tree | 721d5c12d27841137dc82aafcf0901433e547c5c /sample/fib.py | |
parent | 4cccf924fd602a09c253945b343e242d37560292 (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@98 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/fib.py')
-rw-r--r-- | sample/fib.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sample/fib.py b/sample/fib.py new file mode 100644 index 0000000000..8318021d24 --- /dev/null +++ b/sample/fib.py @@ -0,0 +1,10 @@ +# calculate Fibonacci(20) +# for benchmark +def fib(n): + if n<2: + return n + else: + return fib(n-2)+fib(n-1) + +print fib(20) + |