stack follows lastinfirstout methodology stack follows last in first out methodology
class Stack():
    

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

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

    def push(self, val):
        self.entries.append(val)

    def pop(self):
        if self.size() > 0:
            self.entries.pop(self.size() - 1)