mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
Coding style improvements for project_euler problem 45 & 16 (#3087)
* improvements for project euler task 45 * fixed documentation * update pe_16/sol1.py * update pe_16/sol2.py * revert solution changes for sol1 * revert solution changes for sol2 * remove trailing spaces in sol1 * Update sol1.py Co-authored-by: Dhruv <dhruvmanila@gmail.com>
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
"""
|
||||
Problem 16: https://projecteuler.net/problem=16
|
||||
|
||||
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
|
||||
|
||||
What is the sum of the digits of the number 2^1000?
|
||||
"""
|
||||
|
||||
|
||||
def solution(power):
|
||||
def solution(power: int = 1000) -> int:
|
||||
"""Returns the sum of the digits of the number 2^power.
|
||||
>>> solution(1000)
|
||||
1366
|
||||
|
Reference in New Issue
Block a user