well i am trying to come up with a program that searches through different directories in a recursion for a specific file but i need to limit it to only 990 directories, i tried to come up with a code that returns "not found" if the limit exceeds 990 but it returns none, a summary of the code is below, please help.
limit=0
def test():
    global limit
    if limit<10:
        limit+=1
        test()
    else:
        return "limit reached"
print(test())
 
    