We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c01da2 commit 475cdacCopy full SHA for 475cdac
dynamic_programming/fast_fibonacci.py
@@ -8,14 +8,14 @@
8
9
10
# returns F(n)
11
-def fibonacci(n: int): # noqa: E999 This syntax is Python 3 only
+def fibonacci(n: int) -> int: # noqa: E999 This syntax is Python 3 only
12
if n < 0:
13
raise ValueError("Negative arguments are not supported")
14
return _fib(n)[0]
15
16
17
# returns (F(n), F(n-1))
18
-def _fib(n: int): # noqa: E999 This syntax is Python 3 only
+def _fib(n: int) -> int: # noqa: E999 This syntax is Python 3 only
19
if n == 0:
20
# (F(0), F(1))
21
return (0, 1)
0 commit comments