遞迴函式為可以呼叫自己本身的函式,若函式f1()呼叫函式f2(),而函式f2()又在某種情況下呼叫f1(),此情況函式f1()也可算是一個遞迴程式。例如:
result = 1 for i in range(1,7): result = result * i print("5! =",result)
Copyright © All rights reserved | This template is made with by Colorlib