I can't seem to find the answer to this on this site, though it seems like it would be common enough. I am trying to output a double for the ratio of number of lines in two files.
#Number of lines in each file
inputLines = sum(1 for line in open(current_file))
outputLines = sum(1 for line in open(output_file))
Then get the ratio:
ratio = inputLines/outputLines
But the ratio always seems to be an int and rounds even if I initialize it like:
ratio = 1.0
Thanks.