How To Convert Stack To Array In Python