📜  在堆栈中查找最大元素 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:00.137000             🧑  作者: Mango

代码示例1
myStack = []
#Add some elements to stack
myStack = [1, 5, 2, 8, 0]

maximumValue = max(myStack)
print("The maximum value is", maximumValue)