import string


def buildCoder(shift):
    """
    Returns a dict that can apply a Caesar cipher to a letter.
    The cipher is defined by the shift value. Ignores non-letter characters
    like punctuation, numbers and spaces.

    shift: 0 <= int < 26
    returns: dict
    """
    # Check constrain on shift
    assert shift in range(0,26)
    mapping = {} # Mapping letter (plainText) -> letter (cipherText)
    upperCaseLetterRotator = string.ascii_uppercase + string.ascii_uppercase
    lowerCaseLetterRotator = string.ascii_lowercase + string.ascii_lowercase 
    
    for idx, letter in enumerate(upperCaseLetterRotator[:26]):
        mapping[letter] = upperCaseLetterRotator[idx + shift]
    
    for idx, letter in enumerate(lowerCaseLetterRotator[:26]):
        mapping[letter] = lowerCaseLetterRotator[idx + shift]
    
    return mapping