mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
6 lines
140 B
Python
6 lines
140 B
Python
fib 0 = 0
|
|
fib 1 = 1
|
|
# a type annotation is required for the recursive function
|
|
fib(n: Nat): Nat = fib(n-1) + fib(n-2)
|
|
|
|
assert fib(10) == 55
|