We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Enter your code here. Read input from STDIN. Print output to STDOUT
List = []
if name == 'main':
T = int(input())
for i in range(T):
raw_inputs = int(input())
power = pow(2 , raw_inputs)
List.append(power)
for number in List:
if number <= 9:
print(number)
else:
digit_sum = sum(int(digit) for digit in str(number))
print(digit_sum)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #16: Power digit sum
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
List = []
if name == 'main': T = int(input())