@Lokraan/

Fib Pinescript

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def fibonacci(n): 
  a = 0
  b = 1
  if n < 0: 
    print("Incorrect input") 
  elif n == 0: 
    return a 
  elif n == 1: 
    return b 
  else: 
    for i in range(2,n): 
      c = a + b 
      a = b 
      b = c 
    return b 

n = 100
for i in range(1, n):
  _fib = fibonacci(i)
  print(f"     _n == {i} ? {_fib} :")