Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alfabeto = 'qwertyuiopasdfghjklzxcvbnm'
- lista_alfabeto = sorted(alfabeto)
- ##frase = frase.replace('k','m')
- ##frase = frase.replace('o','q')
- ##frase = frase.replace('e','g')
- def traduz(frase):
- traducao = ''
- for letra in frase:
- if letra not in alfabeto:
- traducao += letra
- else:
- indice = lista_alfabeto.index(letra) + 2
- if indice >= len(alfabeto):
- indice = indice - len(alfabeto)
- traducao += lista_alfabeto[indice]
- frase = traducao
- print frase
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement