una funcion que genere un cufrado cesar
def cesar(text, key): alphabet = "abcdefghijklmnopqrstuvwxyz" new_text = "" for i in text: if i in alphabet: position = alphabet.index(i) new_position = (position + key) % 26 new_character = alphabet[new_position] new_text += new_character else: new_text += i return new_text