Answers for "iterative tribonacci python"

0

iterative tribonacci python

def trib_iter(m):
    lista=[m]
    c=0
    d=True
    while d==True:
        novalista=[]
        for n in lista:
            if n in [0,1,2]:
                c+=1
            else:
                for i in range(1,4):
                    if n-i in [0,1,2]:
                        c+=1
                    else:
                        if n-i<0:
                            pass
                        else:
                            novalista.append(n-i)
        if novalista==[]:
            d=False
        else:
            lista=novalista
    return c
Posted by: Guest on June-21-2020

Code answers related to "iterative tribonacci python"

Python Answers by Framework

Browse Popular Code Answers by Language