Professional Documents
Culture Documents
newWord=''
for ch in s:
if ord(ch)+k<=122:
new_ch = chr(ord(ch)+k)
else:
new_ch = chr(ord(ch)+k-26)
newWord = newWord+new_ch
print (newWord)
def main():
file = open("plain.txt", "r")
word = [line.strip() for line in file]
key = eval(input("Please enter the number of positions in the alphabet you wish to
apply: "))
newWord=''
for ch in word:
if ord(ch)+key<=122:
new_ch = chr(ord(ch)+key)
else:
new_ch = chr(ord(ch)+key-26)
newWord = newWord+new_ch
print newWord >> encrypted.txt
def parseSentences(bigString):
return bigString.replace("!", ".").replace("?", ".").split(".")
def replaceNonLetters(s):
nonLetters = [chr(x) for x in range(0, 128) if not chr(x).isalpha()]
for char in nonLetters:
s = s.replace(char, " ")
return s
def parseWords(sentenceList):
best_v = v
goodnesstocompare = goodness
return best_v
print(GoodnessComparer(x))