In preparation for an upcoming national cipher challenge, I was hoping to create a piece of code that would take the coded message as a string and record the frequency of each letter in order to try and figure out what the letter is most likely to be when decoded (I'm sorry if that's not very clear!). This is how I planned to do this:
1) Copy + paste the code into a python program
2) The program would convert the letters to numbers
3) for x in range(0,len(name of variable the string is assigned to): if string[x] in "1":
increase count for '1' by one
x = x + 1
else:
x = x + 1
Then change it to
if string[x] in "2"
and so on until 26 when the program would print the frequency of each number. Any help whatsoever with this code would be appreciated. Even just some pseudocode would massively help.
Thank you!
Matt.
(PS, I'm completely new to this site!)