I’m currently trying to decipher a code using a code breaker that I have to create. I have a list of codes that do not work in the form of a text file and I’m trying to check if the created code is one from the text file, then print the ones that are not.
for code in itertools.product(numbers, repeat=n):
if "0" in code and "4" in code and "5" in code:
with open('../../OneDrive/Desktop/Codes.txt') as input_file:
data = input_file.readlines()
for line in data:
if code in line:
print(''.join(code))
I was hoping that this would work as the code has no errors but it does not
New contributor
Ethan Ford is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2