If I am building a basic encryption program in python that reassigns A to C and D to F and so on, what is a simple algorithm I could use to do this? I have a list named alphabet
str.translate should be the easiest way:
table = str.maketrans( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "cdefghijklmnopqrstuvwxyzabCDEFGHIJKLMNOPQRSTUVWXYZAB" ) s = "Test String" print(s.translate(table))
Output:
Vguv Uvtkpi