DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
fibonacci python
def fib(n: int) -> int: if n in {0,1}: return n a,b = 0,1 for i in range(n-1): a,b = b,a+b return b
Source by docs.python.org #
PREVIOUS
NEXT
Tagged:
#fibonacci
#python
ADD COMMENT
Topic
COMMENT
Name
6+9 =
Submit