class Stack():

    def __init__(self):
        self.list = []

    # push() dodaj coś do stosu
    def push(self, item):
        return self.list.append(item)

    # pop() zdejmij element z stosu
    def pop(self):
        if self.list:
            # ost_elem = self.list.index[-1]
            # self.list.remove(ost_elem)
            # return ost_elem
            return self.list.pop()

    # peek() podejrzyj element na stosie
    def peek(self):
        if self.list:
            return self.list[-1]

    # show() pokaż stos
    def show(self):
        if not self.list:
            print('Stos jest pusty')
            return
        
        print(self.list)

        # if self.list:
        #     print(self.list)
        # else:
        #     print('Stos jest pusty')

    # is_empty() sprawdź czy coś jest na stosie
    def is_empty(self):
        # return self.list
        return not len(self.list) == 0


