I am new to python and programming this is my first time using the code (first assignment). I need help with writing a program to convert the code message entered by the user into ascii numbers, then find which number occurs 12% of the time, and have it represent the letter E (also t is the second most occuring letter at 9% and i'm not sure if I should use that to check), then once I know which letter E is, I have to find out how many letters E is from the letter used in the code to find the shift count.
I did this in lab with help from a TA to get started but I dont understand how to put the logic into code.
This program asked the user for a sentence and changes it into code by a shift of 13. I am completely lost.
import string def main(): user = raw_input("Enter the message you want coded: ") user = string.upper(user) for i in user: if i != ' ': i = ord(i) i += 13 if i > ord('Z'): i-= 26 i = chr(i) print i, main()