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

Tell us what’s happening:

I’m trying to reassign the value of rods[‘A’], but am I doing something wrong/am I missing something? I’m following the instructions.

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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

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

Welcome to the forum @dublin.kimberly

Please use the numbers given in the instructions.

The instructions:

The syntax is range(x, y, h), where x is the starting integer (inclusive), y is the last integer (not inclusive), and h is the difference between a number and the next one in the sequence.

x is correct
y is the last integer that is not inclusive
h is the difference in the sequence of numbers

Happy coding

Hmm, okay, I’m starting to understand. x being 3 is right because that’s where we want to start. We want to end at 1 with 1 step in between? So it would be range(3, 1, 1)? Or am I missing something?

Oh, nevermind. I get it now! Thank you!

1 Like

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