Python/maths/lucasSeries.py
PatOnTheBack 30061ecae3 Improved Formatting and Style
I improved formatting and style to make PyLama happier.

Linters used:

- mccabe
- pep257
- pydocstyle
- pep8
- pycodestyle
- pyflakes
- pylint
- isort
2019-07-05 10:48:16 -04:00

17 lines
358 B
Python

"""Lucas Sequence Using Recursion."""
def recur_luc(n):
"""Calculate Lucas Sequence Using Recursion."""
if n == 1:
return n
if n == 0:
return 2
return recur_luc(n - 1) + recur_luc(n - 2)
LIMIT = int(input("How many terms to include in Lucas series:"))
print("Lucas series:")
for i in range(LIMIT):
print(recur_luc(i))