mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 08:17:01 +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
|
||||
|
||||
|
||||
def solution() -> int:
|
||||
return sum(digitsum(str(i)) for i in range(1000, 1000000))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
count = sum(digitsum(str(i)) for i in range(1000, 1000000))
|
||||
print(count) # --> 443839
|
||||
print(solution())
|
Loading…
Reference in New Issue
Block a user