self.items.append(data) def pop(self): if not self.is_empty(): return self.items.pop() else: print("stack is empty"). 定義⽅法pop. 檢查堆疊是. 否為空串列.
確定! 回上一頁