递归

简介

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# coding:utf-8

count =0

def test():
global count
count += 1

if count != 5:
print('count终止条件不满足,重新执行自己,当前count是:%s' %count)
return test()
else:
print('count is %s'%count)

test()