Find the Nth Term of a Fibonacci Series

    0

    0

    CrypticSai-08

    def Fibonacci(n):
        if n < 2:
            return n
        fs = [0, 1]
        for i in range(1, n):
            fs.append(fs[i] + fs[i - 1])
        return fs[n]
    n = 6
    print(Fibonacci(n))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.