def rot(c,n):
    """rotates c (a single character) by n spots in the alphabet
    """
    if 'a' <= c <= 'z':
        if ord(c) + n <= ord('z'):
            return chr(ord(c) + n)
        else:
            return chr (ord(c) + n - 26)
    elif 'A' <= c <= 'Z':
        if ord(c) + n <= ord ('Z'):
            return chr(ord(c) + n)
        else:
            return chr(ord(c) + n - 26)
    else:
        return(c)