-1
I want to make a program that encrypts a message by the polar Zenit method, which consists of exchanging these letters among themselves, changing the text without the use of accents. I can already change the letters of the first group (Zenit) to those of the second group (polar), and scramble a little the text, but not the other way around because if I just reverse what I already wrote the same input message will be returned. I imagine you can use lists or dictionaries in a better way, but I don’t know how.
A summary of what I have so far:
texto = input("Digite um texto: ")
lista_z = ['z', 'e', 'n', 'i', 't']
for z in lista_z:
texto = texto.replace('z', 'p')
for e in lista_z:
texto = texto.replace('e', 'o')
for n in lista_z:
texto = texto.replace('n', 'l')
for i in lista_z:
texto = texto.replace('i', 'a')
for t in lista_z:
texto = texto.replace('t', 'r')
print(texto)
I’m starting now and I really want this little help to find a solution, from now on thank you.
The idea of your
for
is wrong. you can replace all thesefor
meaningless by function of string class, I suggest a studied– Tmilitino
Friend, can you give an example for me to understand better?
– Lucas