Code about car park
<p>The laughs parking garage contains a single lane that hold up to ten cars. Cars arrive at the south end of the garage and leave from the north end. If a customer arrives to pick up a car
that is not northernmost, all the cars to the north of his car are moved out, his car is driven out,
and the others cars are restored in the same order that they were in originally.
Whenever a car leaves, all the cars to the south are moved forward. So that at all the
times all the empty spaces are in the south part of the garage.
Write python program to reads a group of input lines. Each line contains an “a” arrival or
a “d” departure and a license plate number. Cars are assumed to arrive and depart in the order
specified by the input. The program should print a message each time that a car arrives or
departs. When a car arrives, the massage should specify whether or not there is room for the car
in garage. If there is no room for a car, the car waits until there is room or until a departure line is
read for the car. When room becomes available, another massage should be printed. When a car
departs, the massage should include the number of times the car was moved within the garage
(including the departure itself but not the arrival), this number is 0 if the car departs from the
waiting line.</p>

<p>this is my code. i stuck in middle of the code. i made a queue to park the cars. i don't no how to reassemble the cars when a middle car is departed. and i want a way to print the number of moves before the car depart in park. so anyone can help me?`</p>

<pre><code>class Stack:
    def __init__(self):
        self.items =[]

    def isEmpty(self):
        return self.items ==[]

    def push(self,item):
        self.items.append(item)

    def pop(self):
        return self.items.pop()

    def peek(self):
        return self.items[len(self.items)-1]

    def size(self):
        return len(self.items)

class Queue:
    def __init__(self,maxSize):
        self.items =[]
        self._count = 0
        self._front = 0
        self._back = maxSize - 1


    def isEmpty(self):
        return self.items ==[]

    def enqueue(self, item):
        self.items.insert(0,item)

    def dequeue(self):
        return self.items.pop()

    def size(self):
        return len(self.items)

    def index(self,item):
        return self.items.index(item)



q1park = Queue(maxSize=10)
q2wait= Queue()
q3assemble= Queue() 

x =raw_input("Car number: ")

def cararrival():
    if x[0]=="a":
        while q1park.size ==10:
            q1park.enqueue(x[1:len(x)])
            print(x + "car is arrived")

            if q1park.size ==10:
                print("No room available in the garage")

                x1=raw_input("do you want to wait: ")
                if x1=="yes":
                    q2wait.enqueue(x[1:len(x)])
                elif x1=="no":
                    print("see you next time")
               else:
                    print("Enter yes or no")


def cardepart():
    if x[0]=="d":
        if x[1:len(x)] in q1park:
            while not q1park.index(x[1:len(x)])==0:
                q3assemble.enqueue(q1park.dequeue())
                q3assemble.dequeue()

            while not q3assemble.isEmpty:
</code></pre>