Skip to content

Commit 9aef472

Browse files
authored
Create Fibonacci.py
1 parent 24ba243 commit 9aef472

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Fibonacci.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
a = 0
2+
3+
b = 1
4+
5+
passo = 1
6+
7+
i = 0
8+
9+
10+
11+
num = int(input("Insira um número inteiro: "))
12+
13+
14+
15+
print("Série de Fibonacci")
16+
17+
print("F%d = %d" %(passo,b))
18+
19+
num -= 1
20+
21+
for i in range(num):
22+
23+
aux = a+b
24+
25+
a = b
26+
27+
b = aux
28+
29+
passo = passo+1
30+
31+
print("F%d = %d" %(passo,aux))

0 commit comments

Comments
 (0)