0
def counter(number,count):
if (number!=1 and number%2==0):
a=number/2
count=count+1
counter(a,count)
elif (number!=1 and number%2!=0):
a=3*(number)+1
count=count+1
counter(a,count)
else:
print count
return count
z=counter(13,0)
print z
count
評估爲9
並且它會打印它,但不會返回它嗎?打印'z'時說None
Python函數返回null
非常感謝你們!看起來很傻 – user1468460