human
Can you provide a the Python code you requested given the following:
3. Creating (new type of) exceptions
Exceptions can be created, for example, to increase the functionality of an existing one. All exceptions must be derived (directly or indirectly) from the Exception class.
assistant
#Here is the Python code you requested.
class SmallStack_full(Exception):
    pass
    
class SmallStack_empty(Exception):
    pass

class SmallStack():
    '''A stack structure with 10 slots.'''
    
    def __init__(self):
        '''Create the stack.'''
        self.stack = [None]*10
        self.counter = 0
        
    def push(self, x)->None:
        '''Put "x" on the stack.
        
        Raises SmallStackFull upon fullness.
        '''
        if self.counter < 10:
            self.stack[self.counter] = x
            self.counter += 1
        else:
            raise SmallStack_full
        
    def pop(self)->object:
        '''Remove the last element inserter in the stack.
        
        Raises SmallStackEmpty upon emptyness.
        '''
        if self.counter > 0:
            self.counter -= 1
            return self.stack[self.counter]
        else:
            raise SmallStack_empty

s = SmallStack()

try:
    for i in range(100):
        s.push(i)
        print(i)
except SmallStack_full:
    print('The stack is full. i={}'.format(i))
    
try:
    for i in range(100):
        print(i, s.pop())
except SmallStack_empty:
    print('The stack is empty. i={}'.format(i))