Skip to content

Commit 2f0c2c9

Browse files
nthallstokhos
authored andcommitted
Bring problem_30 solution in line with project style guidelines (TheAlgorithms#2896)
1 parent 5ec69b7 commit 2f0c2c9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: project_euler/problem_30/soln.py renamed to project_euler/problem_30/sol1.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def digitsum(s: str) -> int:
3131
return i if i == int(s) else 0
3232

3333

34+
def solution() -> int:
35+
return sum(digitsum(str(i)) for i in range(1000, 1000000))
36+
37+
3438
if __name__ == "__main__":
35-
count = sum(digitsum(str(i)) for i in range(1000, 1000000))
36-
print(count) # --> 443839
39+
print(solution())

0 commit comments

Comments
 (0)