多層迴圈建議以數學下標習慣i, j, k, …,才不會有上述錯誤。 ... def fact(n): downByOne=n-1 while downByOne > 0: n *= downByOne downByOne -= 1 return n fact(5) ...
確定! 回上一頁