我不明白他们在问什么。有人能澄清这个问题吗?在
问题是:(他们给了我们doc字符串)
在stack_数组模块中编写并测试方法combine。从名为q3.py的模块测试它。在
这是在扩展Stack类。它应该产生与问题1相同的结果,但它必须在堆栈代码定义的最低级别工作。换句话说,这个方法不能调用堆栈push-and-pop,它必须直接处理值。在def combine(self, s2):
"""
-------------------------------------------------------
Combines a second stack with the current stack.
(iterative algorithm)
Use: s3 = s1.combine(s2)
-------------------------------------------------------
Preconditions:
s2 - an array-based stack (Stack)
Postconditions:
Returns:
s3 - the contents of the current stack and s2
are interlaced into s3 - current stack and s2
are empty (Stack)
-------------------------------------------------------
"""
#Write your code here
我已经解决了推,弹出,偷看。在
^{pr2}$