Question: def stack_to_array(stack, target): ------------------------------------------------------- Pops contents of stack into target. At finish, stack is empty. Top value of stack is at end of target,

def stack_to_array(stack, target): """ ------------------------------------------------------- Pops contents of stack into target. At finish, stack is empty. Top value of stack is at end of target, bottom value of stack is at beginning of target. Use: stack_to_array(stack, target) ------------------------------------------------------- Parameters: stack - a Stack object (Stack) target - a Python list (list) Returns: None ------------------------------------------------------- """

NOTE: I already have:

while not stack.is_empty(): target.append(stack.pop()) return stack,target

But it gives me

"Test with array: '[11, 22, 33, 44, 55, 66]'

ERROR:

Expects stack with: [11, 22, 33, 44, 55, 66]" That's what I'm trying to fix

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!