def encrypt_letter(letter, value):
    """ (str, int) -> str

    Precondition: len(letter) == 1 and letter.isupper()

    Returns the letter as an encrypted letter by applying the keystream value.

    >>> encrypt_letter('F', 10)
    'P'
    >>> encrypt_letter('Z', 19)
    'S'
    """
    # Change the letter to a number in the range 0-25. 'A' changes to 0, 'B'
    # changes to 1, 'C' changes to 2 and so on...
    # After changing the number, we add it to the keystream value given, and
    # we use modulo 26 to handle the end of the alphabet.
    i = ((ord(letter) - ord('A')) + value) % 26

    return chr(ord('A') + i)