Clarification regarding the tower of hanoi implementation in Python cert

the said project
One of the tests in the project is that the function should solve the puzzle for any positive value of n, which is confusing me. What exactly is it asking? Because it passes all tests except that one. I ran my solution locally for n up to 7, and it worked correctly. Am I missing something? Please don’t give me the solution directly.
P.s. pardon me if it has been asked before. (If so also share the link to the respective thread.)

Would need to see your code.

Are you using any global variables for example, which might interfere with consecutive tests of the function?

1 Like

Yes, I am using global variables. Why? Am I not allowed to? I thought the tests are checked for separate runs of the program. I’ll just change and check.
P.s. it worked!! Global variables were indeed the problem. Thanks, @pkdvalis !!

1 Like

Test will call the function directly multiple times. You can test this by calling it twice in a row

print(func(args))
print(func(args))

It should return the same result twice in a row

1 Like