Skip to content

Commit b366d52

Browse files
committed
fix: change parameter name to a descriptive word to satisfy bot
1 parent 2289014 commit b366d52

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

maths/lucas_numbers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def lucas_number(n: int) -> int:
1+
def lucas_number(input_index: int) -> int:
22
"""
33
Returns the n-th Lucas number using an iterative approach.
44
The Lucas numbers are an integer sequence where each term is the sum of the
@@ -17,18 +17,18 @@ def lucas_number(n: int) -> int:
1717
>>> lucas_number(-3)
1818
Traceback (most recent call last):
1919
...
20-
ValueError: n must be a non-negative integer.
20+
ValueError: input_index must be a non-negative integer.
2121
"""
22-
if n < 0:
23-
raise ValueError("n must be a non-negative integer.")
22+
if input_index < 0:
23+
raise ValueError("input_index must be a non-negative integer.")
2424

25-
if n == 0:
25+
if input_index == 0:
2626
return 2
27-
if n == 1:
27+
if input_index == 1:
2828
return 1
2929

3030
a, b = 2, 1
31-
for _ in range(2, n + 1):
31+
for _ in range(2, input_index + 1):
3232
a, b = b, a + b
3333
return b
3434

0 commit comments

Comments
 (0)