Project Euler #16: Power digit sum

  • + 1 comment

    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)