def Fibo(n): if n == 1 or n == 2: return 1 else: l = [1,1] for i in range(2 , n): l.append(l[i-1] + l[i-2]) return l[-1] print Fibo(10) def Ribo(n): if n == 1: return 6 else: l = [6] for i in range(1,n): l.append( l[-1]**2 + 5) return l[-1] print Ribo(5)