mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
psf/black code formatting (#1277)
This commit is contained in:

committed by
Christian Clauss

parent
07f04a2e55
commit
9eac17a408
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
def maximum_digital_sum(a: int, b: int) -> int:
|
||||
"""
|
||||
Considering natural numbers of the form, a**b, where a, b < 100,
|
||||
@ -18,9 +16,17 @@ def maximum_digital_sum(a: int, b: int) -> int:
|
||||
"""
|
||||
|
||||
# RETURN the MAXIMUM from the list of SUMs of the list of INT converted from STR of BASE raised to the POWER
|
||||
return max([sum([int(x) for x in str(base**power)]) for base in range(a) for power in range(b)])
|
||||
return max(
|
||||
[
|
||||
sum([int(x) for x in str(base ** power)])
|
||||
for base in range(a)
|
||||
for power in range(b)
|
||||
]
|
||||
)
|
||||
|
||||
#Tests
|
||||
|
||||
# Tests
|
||||
if __name__ == "__main__":
|
||||
import doctest
|
||||
|
||||
doctest.testmod()
|
||||
|
Reference in New Issue
Block a user