I am a Python student in the very early stages of learning.
Today I discovered the recursive functions and, to try, I wrote the following code. The goal was to possibly trigger a message looking for a Boolean return, but the return always returns as None.
I would like to add that the boolean trigger works if the input is exactly "0".
To me, the code is as simple as possible, so I'm not sure what caused the return None. This must be a technical detail to which I have not been exposed. Any help is appreciated.
def countdown(s): # Why doesn't this return True even if it prints blastoff? if s <= 0: print(s) print("Blastoff!") return True elif s > 0: print(s) countdown(s-1) tMinus = int(input("Type a number: ")) if countdown(tMinus): print("He's gone, Jim!")