def rot(c, n):
    """ This function rotates a single character c forward by n spots in the alphabet. """
    # check to ensure that c is a single character
    assert(type(c) == str and len(c) == 1)
    
    if 'a' <= c <= 'z':
        new_ord = ord(c) + n
        if new_ord > ord('z'):
            new_ord = ord(c) + n - 26
    elif 'A' <= c <= 'Z':
        new_ord = ord(c) + n 
        if new_ord > ord('Z'):
            new_ord = ord(c) + n - 26
    else: 
        return c
    
    return chr(new_ord)