I have made a caesar cipher solver in python, but there are no errors, it's just not printing anything. I have done similar things, but this hasn't happened before.
with open("C:\\Users\\Rajive\\AppData\\Local\\Programs\\Python\\Python3.4.3\\brit-a-z.txt", 'r') as f:
check_list = [x.strip() for x in f.readlines()]
def crackcaesar(encrypted):
for i in range(26):
totalwords = 0
numright = 0
answer = []
if i != 0:
for symbol in encrypted:
if symbol.isalpha():
neword = (ord(symbol) + i)
if symbol.isupper():
if neword > ord('Z'):
neword -= 26
elif neword < ord('A'):
neword += 26
elif symbol.islower():
if neword > ord('z'):
neword -= 26
elif neword < ord('a'):
neword += 26
newletter = chr(neword)
answer.append(newletter)
for word in str(answer):
totalwords += 1
for line in check_list:
if line == word:
numright += 1
if (numright // 2) > (totalwords // 2):
print(str(answer))
print("Type your encoded caesar cipher message")
while True:
crackcaesar(input())