Skip to content

Commit 6cd118d

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent f7d341e commit 6cd118d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

project_euler/problem_01/sol8.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
88
"""
99

10-
def solution(n,target):
10+
11+
def solution(n, target):
1112
"""
1213
Efficient Solution for Sum Multiple of 3 or 5
1314
@@ -32,15 +33,15 @@ def solution(n,target):
3233
"""
3334
if target > 0: # check for positive or negative
3435
p = target // n
35-
return (n*(p*(p+1))) //2
36+
return (n * (p * (p + 1))) // 2
3637
else:
3738
return 0
3839

3940

4041
if __name__ == "__main__":
4142
N = int(input())
42-
m = N-1
43-
print(solution(3,m) + solution(5,m) - solution(15,m))
44-
45-
# For detail explanation of the above problem head to the below link:
46-
# https://github.com/BigOh-Koders/INCF2019/blob/master/MUL35/explanation.pdf
43+
m = N - 1
44+
print(solution(3, m) + solution(5, m) - solution(15, m))
45+
46+
# For detail explanation of the above problem head to the below link:
47+
# https://github.com/BigOh-Koders/INCF2019/blob/master/MUL35/explanation.pdf

0 commit comments

Comments
 (0)