FAQ: Learn Python: Loops - Nested Loops

We cannot tell where the block indentation is but those last two lines should not be in the same loop as each other. Something to check, there.

I do not understand why I am getting this error as the Stack class which was imported in the first line has the _get_name attribute.