Python program with functions that extracts specific characters from a text file. (e.g. .,#!?) Solution data=[] flag=False with open(\'/tmp/myFile.txt\',\'r\') as f: for line in f: if line.startswith(\'&\'): flag=True if flag: data.append(line) if line.strip().endswith(\'#!?\'): flag=False print \'\'.join(data).