data_stack = list() data_stack.append(1) data_stack.append(2) data_stack // [1, 2] data_stack.pop() // 2 stack_list = list() def push(data): stack_list.append(data) def pop(): data = stack_list[-1] del stack_list[-1] return data for index in range(10): push(index) pop() // 9 | cs |
::public/Python