結果 : compute cost function in python code