We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8d6513 commit f59ef10Copy full SHA for f59ef10
Data Structures and Algorithms/stack/stack.py
@@ -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