mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-29 17:08:49 +08:00
The black formatter is no longer beta (#5960)
* The black formatter is no longer beta
* pre-commit autoupdate
* pre-commit autoupdate
* Remove project_euler/problem_145 which is killing our CI tests
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
co-authored by
github-actions
parent
c15a4d5af6
commit
24d3cf8244
@@ -18,7 +18,7 @@ def solution(power: int = 1000) -> int:
|
||||
>>> solution(15)
|
||||
26
|
||||
"""
|
||||
num = 2 ** power
|
||||
num = 2**power
|
||||
string_num = str(num)
|
||||
list_num = list(string_num)
|
||||
sum_of_num = 0
|
||||
@@ -31,6 +31,6 @@ def solution(power: int = 1000) -> int:
|
||||
|
||||
if __name__ == "__main__":
|
||||
power = int(input("Enter the power of 2: ").strip())
|
||||
print("2 ^ ", power, " = ", 2 ** power)
|
||||
print("2 ^ ", power, " = ", 2**power)
|
||||
result = solution(power)
|
||||
print("Sum of the digits is: ", result)
|
||||
|
||||
@@ -19,7 +19,7 @@ def solution(power: int = 1000) -> int:
|
||||
>>> solution(15)
|
||||
26
|
||||
"""
|
||||
n = 2 ** power
|
||||
n = 2**power
|
||||
r = 0
|
||||
while n:
|
||||
r, n = r + n % 10, n // 10
|
||||
|
||||
Reference in New Issue
Block a user