#coding:utf-8
def testReturn(x):
if x > 10000:
return
print "test return!!" #这句话永远不会得到执行
elif x > 1000:
return 100
elif x > 100:
return 10
elif x > 10:
return 1
else:
return 0
print testReturn(9999999) #result = None
print testReturn(9999) #return = 100
print testReturn(999) #return = 10
print testReturn(99) #return = 1
print testReturn(9) #return = 0
#return使用说明:
#(1)返回函数的返回值
#(2)终止程序的运行,提前退出.(例如:当函数内有错误发生时,使用return可以终止函数的运行)