import math def exp_log(base, power): return power * math.log(base) def read_exps(): with open("../txt/e099.txt", "r") as f: return [(exp_log(int(s[0]), int(s[1])), i + 1) for i, line in enumerate(f.readlines()) if (s := line.split(","))] def euler_099(): exps = read_exps() exps.sort() return exps[-1][1] if __name__ == "__main__": solution = euler_099() print("e099.py: " + str(solution)) assert(solution == 709)