This was another easy one. Using natural logarithms, this routine runs very quickly (< 5 seconds). I also used the decimal class just in case I needed extra precision.
#Euler99 import psyco psyco.full() import decimal class Problem: def Solution(self): decimal.getcontext().prec = 50 P = [] f = open("base_exp.txt", "r") for row in f.readlines(): newRow = [] for column in row.split(","): newRow.append(int(column)) P.append(newRow) f.close() max = 0 pos = 0 for pair in P: v = decimal.Decimal(pair[1]*decimal.Decimal(pair[0]).ln()).exp() if v > max: max = v pos = P.index(pair)+1 print P.index(pair)+1, return "\nAnswer = " + str(pos) if __name__ == '__main__': P = Problem() print P.Solution()