Skip to content

Commit f59ef10

Browse files
authored
Add files via upload
1 parent c8d6513 commit f59ef10

File tree

1 file changed

+27
-0
lines changed
  • Data Structures and Algorithms/stack

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
class stack:
2+
3+
def __init__(self):
4+
self.items=input()
5+
print(self.items.lstrip)
6+
7+
def is_empty(self):
8+
return self.items==[]
9+
10+
def push(self,item):
11+
self.items.insert(0,item)
12+
13+
def pop(self):
14+
return self.items.pop(0)
15+
16+
def print_stack(self):
17+
print(self.items)
18+
19+
stack1=stack()
20+
stack1.push(5)
21+
stack1.pop()
22+
stack1.print_stack()
23+
24+
25+
26+
27+

0 commit comments

Comments
 (0)