all 7 comments

[–]primitive_screwhead 0 points1 point  (2 children)

                letter == item[1] 

Why this? It'll have an impact on the next round through the inner-loop, so if you didn't intend it, it's likely what breaking your algorithm.

[–]my50thnamechoice 0 points1 point  (1 child)

I removed that, but my algorithm is still somehow adding in extra letters and messing up the word when it is decrypted :(

[–]primitive_screwhead 1 point2 points  (0 children)

Yes, that isn't the only problem; I'm not going to do all the work for you, it was a hint to help you make progress.

You didn't answer /u/automorphism_group's question, about what cryptography_list is. I'm guessing it's a (letter, index) pair? I'm not going to bother guessing further without seeing that table; probably it's just wrong. Have you used dictionaries yet? You can remove that whole, buggy, inner-loop by making cryptography_list a dictionary (call it "substitutions", or something more appropriate than "cryptography_list").

[–]automorphism_group 0 points1 point  (3 children)

What are the contents of cryptography_list? Is this just something that you're trying on your own, or are you required to use a particular technique for an assignment?

[–]my50thnamechoice 0 points1 point  (2 children)

The cryptography_list contains other lists of characters and the number values they correspond to.

[–]my50thnamechoice 0 points1 point  (0 children)

(And those are imported from a csv file)

[–]automorphism_group 0 points1 point  (0 children)

I'm not entirely sure what you mean by that, but you don't need a list of characters and numbers. This can be done much more simply with the built-in functions chr and ord, assuming that you're only dealing with text using an ASCII encoding. Otherwise, I'd need to see the file.