FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python_practice/stackImpl.py at master · danglingmind/python_practice · GitHub
danglingmind
python_practice
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python_practice
/
stackImpl.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (14 loc) · 378 Bytes
Breadcrumbs
python_practice
/
stackImpl.py
Copy path
File metadata and controls
14 lines (14 loc) · 378 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class
stack
:
'a general stack structure'
def
__init__
(
self
):
self
.
items
=
[]
def
isEmpty
(
self
):
return
self
.
items
==
[]
def
push
(
self
,
item
):
return
self
.
items
.
append
(
item
)
def
pop
(
self
):
return
self
.
items
.
pop
()
def
top
(
self
):
return
self
.
items
[
len
(
self
.
items
)
-
1
]
def
size
(
self
):
return
len
(
self
.
items
)
Back
|
FazBrowse Home
|
New Git URL