repl.it
@manoj2rox/

stack creation

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#stack Creation
class stack(object):

  def __init__(self):
    self.items = []

  def isEmpty(self):
    return self.items == []

  def push(self,value):
    self.items.append(value)

  def pop(self):
    return self.items.pop()
  
  def peek(self):
    return (self.items[len(self.items)-1])

  def size(self):
    return len(self.items)

?