Digits of a Power

Large powers quickly become long numbers, but Python can still work with them directly. Write a function power_digit_sum that raises 2 to the power e, then adds all digits of the resulting number. Return the digit sum, not the huge number itself.

Примеры

Ввод
4
Вывод
7
Ввод
15
Вывод
26
Ввод
1000
Вывод
1366

Нужно реализовать

def power_digit_sum(e: int) -> int:

Теги

math
PostgreSQLv16

Tutaj pojawi się wynik wykonania kodu

Visible tests
1
Input
4
Expected7
2
Input
15
Expected26
3
Input
1000
Expected1366
4
Input
0
Expected1
5
Input
10
Expected7
6
Input
1
Expected2
Focus radio
Paused · SomaFM · Fluid