Towers of Hanoi - Attribute Error when following video walkthrough

Hi Codecademy community,

I’m stuck on the Towers of Hanoi project (https://www.codecademy.com/paths/computer-science/tracks/linear-data-structures/modules/cspath-stacks/projects/towers-of-hanoi) I have followed the developer walkthrough, and I believe I am fully synced with it, but I am still having the following issue:

Per Step 20, I am testing my get_input function and getting an AttributeError. Here is my code next to the error:

What am I missing here? I validated that stack.py (which I have not changed) contains the get_name method.

Thanks!
Pat

Hey y’all,

I gave my code another super close inspection, and I believe I figured out the issue using something I had missed early on in the walkthrough. Hopefully someone smarter than me can confirm, but I believe my error above was actually in Line 10, where I appended a list to the list, as opposed to appending each of my Stacks individually.

I tried both:
stacks.append(left_stack)
stacks.append(middle_stack)
stacks.append(right_stack)

and:
stacks += [left_stack, middle_stack, right_stack]

separately instead of what I previously had in Line 10, and either of those appear to work.

And now I can have a beer.

:slight_smile:

Yes. stacks is a list of stacks. You were originally appending to it another list of stacks, rather than three individual stacks.

For an “graphical” add-on to this script (and a link to a self-solving version) see here.