Skip to content

Commit bfce12b

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

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
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 i 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
28-
"""
29+
"""

maths/area.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,17 @@ def area_of_parabola(x,a,b,c):
270270
"""
271271
Area under the parabola y = 1x² + 0x + 0 from x = 0 to x = 2 is 2.666666666666667
272272
"""
273-
return a * x**2 + b * x + c
273+
return a * x**2 + b * x + c
274274

275275
def area_under_parabola(a, b, c, x1, x2):
276276
area, _ = quad(parabola, x1, x2, args=(a, b, c))
277277
return area
278-
#example usage
278+
#example usage
279279
a = 1
280-
b = 0
280+
b = 0
281281
c = 0
282282
x1 = 0
283-
x2 = 2
283+
x2 = 2
284284

285285
area = area_under_parabola(a, b, c, x1, x2)
286286
print(f"Area under the parabola y = {a}x² + {b}x + {c} from x = {x1} to x = {x2} is {area}")

0 commit comments

Comments
 (0)