# L-21 MCS 260 : i/o of stack
"""
Definition of input/output operations for a stack.
"""
from stack_data import STACK

def push_all(elements):
    """
    pushes elements of a list to the stack"
    """
    for item in elements:
        STACK.insert(0, item)

def show_all():
    """
    shows all elements in the stack
    """
    print(STACK)

def show_top():
    """
    shows the top element of the stack
    """
    if len(STACK) > 0:
        print(STACK[0])
    else:
        print('the stack is empty')
