1 2 3 4 5 6 7 8 9 10 11
maxsum = 0 for a in range(0,100): for b in range(0,100): count = 0 temp = str(pow(a,b)) for x in range(0,len(temp)): count += int(temp[x]) if count > maxsum: maxsum = count print(maxsum)