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 1c462c1 commit cc19f27Copy full SHA for cc19f27
maths/leonardo_numbers.py
@@ -35,7 +35,7 @@ def leonardo_numbers(n: int) -> int:
35
if not isinstance(n, int) or n < 0:
36
raise ValueError("n must be a non-negative integer")
37
38
- if n == 0 or n == 1:
+ if n in (0, 1):
39
return 1
40
41
previous, current = 1, 1
@@ -48,4 +48,4 @@ def leonardo_numbers(n: int) -> int:
48
if __name__ == "__main__":
49
import doctest
50
51
- doctest.testmod()
+ doctest.testmod()
0 commit comments