from string import ascii_uppercase
def chiffrement_affine(a,b,lettre):
    lettre = lettre.upper() # on convertir la lettre en majuscule... au cas où...
    x = ascii_uppercase.index(lettre)
    r = (a * x + b) % 26
    return ascii_uppercase[r]
