我真的不明白這是如何工作的,爲什麼10不是函數的變量?我從來沒有見過一種情況,你可以將一個函數應用到該函數之外的某個項目。我不想要這個問題的答案,只是想了解它。在Python中應用帶一個參數值的函數
謝謝你們夥計
寫一個叫做general_poly的函數,它符合下面的規範。 例如,general_poly([1,2,3,4])(10)應該計算爲1234,因爲1 * 103 + 2 * 102 + 3 * 101 + 4 * 100因此在該示例中,僅函數與general_poly([1,2,3,4])一個參數,它返回一個函數,您可以應用於一個值,在這種情況下,x = 10 general_poly([1,2,3,4])(10 )。
非常感謝!我所需要的。 – Aionis