Instruction myfun1(count)
performs a recursive call but you don't do anything of the value returned by this call. You need to return a value when you reach the end of your function. Otherwise, when the end of the function is reached, you have an implicit return None
statement.
So if you want to return the result of your recursive call, do something like that:
def myfun1(count):
count += 1
if count == 10:
return count
print(count)
result = myfun1(count)
return result
if __name__ == '__main__':
print(myfun1(0))
Generally speaking when a function (recursive or not) is supposed to return something that it computed, make sure that it ends with a return
statement.