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
7 changes: 4 additions & 3 deletions homework/github_week3/fibonacci.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ def fibonacci_list(n: int) -> typing.List[int]:
pass


def fibonacci_single(n: int) -> int:
def fibonacci_single(nomer: int) -> int:

"""Returns the nth Fibonacci number"""
pass
return ((golden_section_num()**nomer) - ((-1 * golden_section_reciprocal())**nomer))/(5**(1/2))


def golden_section_num() -> float:
"""Returns the golden section number (capital Phi)"""
pass
return (5**(1/2) + 1)/2


def golden_section_reciprocal() -> float:
Expand Down