with open(filename) as f: content = f.readlines()# you may also want to remove whitespace characters like `n` at the end of each linecontent = [x.strip() for x in content]

with open(filename) as f: content = f.readlines()# you may also want to remove whitespace characters like `n` at the end of each linecontent = [x.strip() for x in content]