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

Tell us what’s happening:

How will I assign the values? Isn’t this okay?

Your code so far


/* User Editable Region */

rods = {
    'A': [i for i in 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/120.0.0.0 Safari/537.36

Challenge Information:

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

1 Like

Hello snigd,

You don’t need to loop through the range, and since range() basically returns a list you don’t need the aquare brackets either. Just your range call is enough.

3 Likes

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