I am a Python student in the early stages of learning.
Today I learned about recursive functions and, in an attempt to prove it, I wrote the following code. The goal was to eventually activate a message by checking a Boolean return, but the return still appears as None.
I would like to add that the Boolean trigger works if the input is exactly "0".
In my eyes, the code is as simple as it can be, so I am not sure what is causing the return of any. It must be some 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!")