What is the best way to calculate this in a loop in Python (or NumPy, if you think it is preferred for this kind of operation)?
KT = K0[1]*Var0 + K1[1]*Var1 + K2[1]*Var2 + K3[1]*Var3 +
K0[2]*Var0 + K1[2]*Var1 + K2[2]*Var2 + K3[2]*Var3 +
...
K0[51]*Var0 + K1[51]*Var1 + K2[51]*Var2 + K3[51]*Var3
where K0 is an array, containing 51 coefficients (floats). The same for K1, K2 and K3.
Var0, Var1, Var2 and Var3 are constants.
KT is the result, depending on Var0, ... Var3. The coefficient arrays are always the same. They do not change.
I'm coming from Fortran, and am currently learning/experimenting with Python, so forgive maybe the novice question. Python loops sometimes behave un-intuitively to me.