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

I am using the sequence of number and assigning it to rods[‘A’]

Your code so far


# User Editable Region

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

# 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/122.0.0.0 Safari/537.36

Challenge Information:

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

Hello @gomti.agarwal9

This is a good course. You’re almost right, but instead of doing that in another assignment line (outside the original rods declaration), think how you would do it at the same time that declares rods.

rods = {
    'A': [],  # something happens here.
    'B': [],
    'C': []
}

thank you so much it worked.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.