I have this code which compares a number to a number(what i called item in my code) in the domain range to see if it is already there. If it its then print to the output file if it is not then only print it once.
Question How to make sure that if the number isn't between the domain range then print only one time. ( I used true and false statements but this doesn't work because when it is false, it would print several duplicates- on the code below i am not sure how to implement so that it print the number that not in the domain range once instead of multiple times )
for item in lookup[uniprotID]:for varain in wholelookup[uniprotID]:for names in wholeline[uniprotID]:statement=Falseif re.search(r'\d+',varain).group(0)==item and start <= int(item) <= end:result = str(int(item) - start + 1)if varain in names.split(' '):statement = Trueprint ">{0} | at position {1} | start= {2}, end= {3} | description: {4} | {5}".format(uniprotID, result, start, end, varain, names)if statement == True:print(''.join(makeList[start-1:end]))