I can't figure out why just only one is not correct. I really need to understand this. Please, help me
import sys
import csv
# Open sequence file
sequence_file = open(str(sys.argv[2]), 'r')
sequence_cursor = sequence_file.read()
sequence = str(sequence_cursor)
# Open database and copy in a dictionary struture
result_dic = []
with open(str(sys.argv[1]), 'r') as arquivo_dict:
leitorDic = csv.DictReader(arquivo_dict, delimiter=',')
for row in leitorDic:
result_dic.append(row)
# Gets the longest sequence for each STR
STRs = ['AGATC', 'AATG', 'TATC']
result = [0, 0, 0]
i = 0
for strs in STRs:
counter = 0
str_temp = strs
while strs in sequence:
counter += 1
strs += str_temp
result[i] = counter
i += 1
# Match the results and print the right name
j = 0
for person in result_dic:
if int(result_dic[j]['AGATC']) == result[0] and int(result_dic[j]['AATG']) == result[1] and int(result_dic[j]['TATC']) == result[2]:
print(result_dic[j]['name'])
exit()
j += 1
print('No match')
exit()