def countup(k, n):
'counts up from k to n'
if k == n:
print(k)
elif n <= 0:
print("Let's go!")
else:
print(k)
countup(k+1,n)
我想在递归开始之前添加一个“Let's Go”的打印语句,所以它看起来像这样:
计数(3,6)
我们走吧!
3
4
5
6