I'm trying to execute an if loop inside a program to extract some values. But I only want to extract them if the following is true,
if ((letter in lines) == (letters in data)) and ((nr in lines) == (nr in data)) dt = a*c outfile.write(dt + '\n') elif dt = 0 outfile.write(dt + '\n')
I have read in a file with a for loop and thats where lines comes from and also read in another file with a for loop, but underneath the first one. So lines and data are just different files I want to compare.
Does anyone have a suggestion on how to write the if loop with this many arguments? I always want write the results (i.e. dt) to outfile and save it there.