mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 06:33:44 +00:00
Bring problem_30 solution in line with project style guidelines (#2896)
This commit is contained in:
parent
edf2cd2b0c
commit
a56e548264
|
@ -31,6 +31,9 @@ def digitsum(s: str) -> int:
|
||||||
return i if i == int(s) else 0
|
return i if i == int(s) else 0
|
||||||
|
|
||||||
|
|
||||||
|
def solution() -> int:
|
||||||
|
return sum(digitsum(str(i)) for i in range(1000, 1000000))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
count = sum(digitsum(str(i)) for i in range(1000, 1000000))
|
print(solution())
|
||||||
print(count) # --> 443839
|
|
Loading…
Reference in New Issue
Block a user