Learn Recursion by Solving the Tower of Hanoi Puzzle - Step 3

Tell us what’s happening:

Is the problem the range or another issue?

I have tried all of these in the ( )
3,0,1
3,0,-1
3,1,1
3,1,-1

Your code so far


# User Editable Region

rods = {
    'A': [range(3,1,1)],
    'B': [],
    'C': []
}

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn Recursion by Solving the Tower of Hanoi Puzzle - Step 3

Hi @mboblop

Here is a post you may find helpful.

Happy coding

1 Like

This was the solution, had to add new line of code instead of editing the code inside the bracket.

rods = {
‘A’: ,
‘B’: ,
‘C’:
}
rods[‘A’]= range(3, 0,-1)

Thanks, I understood logic of the range (3,0,-1) but It wasn’t working inside that bracket, therefore I had use the correct range on the new line code.

It can work inside rods if you remove the brackets.