Queue Function In Python Practice