Skip to content

Commit fc53f8b

Browse files
authored
Create Fibonacci Number.py
Find the Fibonacci number
1 parent 7853167 commit fc53f8b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Fibonacci Number.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution(object):
2+
def fib(self, N):
3+
"""
4+
:type N: int
5+
:rtype: int
6+
"""
7+
a,b = 0,1
8+
for i in range(N):
9+
a,b = b,b+a
10+
return a

0 commit comments

Comments
 (0)