Python solution to the Elevator Problem