Created
October 15, 2010 07:25
-
-
Save zeekay/627771 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let square x = x *. x;; | |
square 10;; | |
def square(x): x**x | |
square(10) | |
let rec fib n = if n < 2 then 1 else fib(n-1) + fib(n-2);; | |
fib 10;; | |
rec fib(n): | |
if n < 2: | |
1 | |
else: | |
fib(n-1) + fib(n-2) | |
or even just | |
rec fib(n): if n <2 then 1 else fib(n-1) + fib(n-2) | |
fib(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment