dimanche 3 octobre 2021

how to read if statement the way i have the input [closed]

def encrypt(phrase):
    translation = ""
    for letter in phrase:
        if letter.lower() in "a":
            translation = translation + "8nS9H2g"
        if letter.lower() in "b":
            translation = translation + "87waDFGO"
        if letter.lower() in "c":
            translation = translation + "y8F4oP5"
        if letter.lower() in "d":
            translation = translation + "gF67aIgGfu43"
        if letter.lower() in "e":
            translation = translation + "w76A8ftWfw"
        if letter.lower() in "f":
            translation = translation + "wA67f8W9a54"
        if letter.lower() in "g":
            translation = translation + "w6fD78aFi3w"
        if letter.lower() in "h":
            translation = translation + "gH8aLgwaAw8w"
        if letter.lower() in "i":
            translation = translation + "gE987shUi6wa"
        if letter.lower() in "j":
            translation = translation + "678fAwuIg7f9"
        if letter.lower() in "k":
            translation = translation + "F89waOgbf798W"
        if letter.lower() in "l":
            translation = translation + "w8Agofw9Ga08"
        if letter.lower() in "m":
            translation = translation + "9gS8fEo89Dt8"
        if letter.lower() in "n":
            translation = translation + "gtoAe7R98a7oJ"
        if letter.lower() in "o":
            translation = translation + "W8aOgtIl78wa"
        if letter.lower() in "p":
            translation = translation + "eHs809g7U0oEuh"
        if letter.lower() in "q":
            translation = translation + "876wFAowf7wW7"
        if letter.lower() in "r":
            translation = translation + "F86WaogIvbuy07w"
        if letter.lower() in "s":
            translation = translation + "w8A7fo9o7a9Of"
        if letter.lower() in "t":
            translation = translation + "8gf6Wa9goIfy7wO"
        if letter.lower() in "u":
            translation = translation + "6f87RsaFitw7iOa"
        if letter.lower() in "v":
            translation = translation + "g89OfaG7wf89a"
        if letter.lower() in "w":
            translation = translation + "wA879fGwa80Of98"
        if letter.lower() in "x":
            translation = translation + "ga76FdwaIu89"
        if letter.lower() in "y":
            translation = translation + "Wa876IfwAi867843"
        if letter.lower() in "z":
            translation = translation + "ad568w7adx67gw"
        if letter.lower() in " ":
            translation = translation + "5w78aIcawAwC67"

    return translation


print(encrypt(input("enter a phrase: ")))

Aucun commentaire:

Enregistrer un commentaire