Ai
1 Star 0 Fork 0

lvzr/Four_Arithmetic_Operations for python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Stack.py 537 Bytes
一键复制 编辑 原始数据 按行查看 历史
lvzr 提交于 2018-03-31 11:14 +08:00 . push project
# -*- coding: utf-8 -*-
# @Time : 2018/3/26 16:14
# @Author : Lv Zhangrun
# @Site :
# @File : Stack.py
# @Software: PyCharm
class Stack:
"""模拟栈"""
def __init__(self):
self.items = []
def isEmpty(self):
return len(self.items) == 0
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
if not self.isEmpty():
return self.items[len(self.items) - 1]
def size(self):
return len(self.items)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lzrun/Four_Arithmetic_Operations-for-python.git
git@gitee.com:lzrun/Four_Arithmetic_Operations-for-python.git
lzrun
Four_Arithmetic_Operations-for-python
Four_Arithmetic_Operations for python
master

搜索帮助