Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fixme.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
def fibonacci_iterative(n):
if n <= 0:
return 0
elif n == 2: #Fix me
elif n == 1: #Fix me
return 1

a, b = 0, 1
for _ in range(2, n+1):
a, b = b, a + b
return b # Fix me.
return b # Fix me.

n = 10
print(f"The {n}th Fibonacci number is: {fibonacci_iterative(n)}")