Skip to content

Commit a9fc330

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6ca442e commit a9fc330

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

final_lucas_function.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
#Giving the output
1+
# Giving the output
22
def lucas_func(n):
3-
#PREDFINING THE VALUES
3+
# PREDFINING THE VALUES
44
a = 2
55
b = 1
6-
6+
77
if n == 0:
88
return a
9-
10-
# GENERATING THE NUMBER
9+
10+
# GENERATING THE NUMBER
1111
for _ in range(2, n + 1):
1212
c = a + b
1313
a = b
1414
b = c
15-
15+
1616
return b
17-
18-
# USER INPUT
17+
18+
19+
# USER INPUT
1920
n = int(input("Enter the position n to find the nth Lucas Number: "))
2021
print(f"The {n}th Lucas Number is: {lucas_func(n)}")
2122

2223
"""
2324
24-
THE OUTPUT:-
25+
THE OUTPUT:-
2526
Enter the position n to find the nth Lucas Number: 6
2627
The 6th Lucas Number is: 18
2728

0 commit comments

Comments
 (0)