String/list index out of range in a cypher

Viewed 19

here is my code:

for i in strong.split("/"):
    if i in lis:
       char.append(string.printable[lis.index(i)+cypher-cypher2])
    else:
       char.append(string.printable[round(int(i))-cypher+cypher2])
res.append(''.join(char))

its an emoji and number based cypher decryptor, and it checks if the value in the list is in an emoji list, else it uncyphers by numbers. my issue is that when trying to decypher a string, it often says "TypeError: string index out of range". the encryptor script can successfully loop aroud the list, so if the index is -2, ittl just get the penultimate of the list. in the decrypt script as shown above, it doesnt do that and throws an error at me. when i try making a list out of the string.printable, it does the same but with the list index. can anyone help please? error

0 Answers
Related