DEV Community

Discussion on: Share a code snippet in any programming language and describe what's going on

Collapse
 
saptakbhoumik profile image
SaptakBhoumik
def fib(n:int) -> int :
    if n <= 0:
        return 1
    return fib(n-1) + fib(n-2)

def main():
    count:int = 0
    res:int = 0

    while count < 40:
        res = fib(count)
        count++
Enter fullscreen mode Exit fullscreen mode

Recursive fib in peregrine which is a python like language I have been working on:). Check it out :- github.com/peregrine-lang/Peregrine

Collapse
 
pandademic profile image
Pandademic

nice ! look's great!

Collapse
 
saptakbhoumik profile image
SaptakBhoumik

Thanks:)