diff --git a/codes/python/chapter_stack_and_queue/array_stack.py b/codes/python/chapter_stack_and_queue/array_stack.py index b1640a068..23e4b4b5d 100644 --- a/codes/python/chapter_stack_and_queue/array_stack.py +++ b/codes/python/chapter_stack_and_queue/array_stack.py @@ -60,8 +60,8 @@ if __name__ == "__main__": print("栈顶元素 peek =", peek) """ 访问索引 index 处元素 """ - num = stack.get(3); - print("栈索引 3 处的元素为 num =", num); + num = stack.get(3) + print("栈索引 3 处的元素为 num =", num) """ 元素出栈 """ pop = stack.pop() @@ -74,4 +74,4 @@ if __name__ == "__main__": """ 判断是否为空 """ is_empty = stack.is_empty() - print("栈是否为空 =", is_empty) \ No newline at end of file + print("栈是否为空 =", is_empty)