結果 : how to check if stack is not empty python