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

Tell us what’s happening:

rods = {
‘A’: list(range(3, 0, -1)),
‘B’: ,
‘C’:
}
I am trying to use the range function to assign numbers to rods[‘A’] but it is wrong.

Your code so far


# User Editable Region

rods = {
    'A': list(range(3, 0, -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/126.0.0.0 Safari/537.36

Challenge Information:

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

Where did list() come from? You have been asked to use range().

Got it.Initially I wrote the right code but the problem was with the values.

1 Like

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