I\'m having trouble pinpointing the exact problem in my code. I have two functions- inrange(), which checks to see if a port is in range, and filt(), w
Your filt function checks every port it finds against both sets of ranges - I'd suggest rewriting that function to parse out the protocol from the line being read, and pass that variable to inrange along with the port number.
A small additional note - in the inrange function you're testing the same condition in both the if and elif branches.