import math numstring = str(pow(2,1000)) sum = 0 for x in range(0,len(numstring)): sum += int(numstring[x]) print(sum)