Could you give a little more information? What I think you want to do is change the coefficients of x[i] in that particular constraint. If that's it, then you should save the constraint by assigned it to a variable (or adding it to a list):
lhs.addTerms(temp, x[i])
savedConstraint = model.addConstr(cost, GRB.EQUAL, 1.0/a*lhs, 'cost_cons')
Then, in the next iteration, you can use chgCoeff (see http://www.gurobi.com/documentation/5.6/reference-manual/py_model_chgcoeff).
model.chgCoef(savedConstraint,x[i],newtemp)
Is that what you were looking for? Often people will save the constraints to a list. Lastly, you might want to be consistent with your naming (lhs on the right side is a bit off).