python是解释型语言,下面的程序深刻的说明了这个问题。
import turtle def branch(length,level): if level<=0: return turtle.forward(length) turtle.left(45) branch(0.6*length,level-1) turtle.right(90) branch(0.6*length,level-1) turtle.left(45) turtle.backward(length) return turtle.left(90) branch(100,6)