Python program using functions that extracts specific charac

Python program using functions that extracts specific characters (e.g. .,#!?) from a text file. It should remove all the specific characters and replace them with a space.

Solution

tada=[] bool=False with open(\'/tmp/myFile.txt\',\'r\') as f: for line in f: if line.startswith(\'#\'): bool=True if bool: tada.append(line) if line.strip().endswith(\'?\'): bool=False print \'\'.join(tada)
Python program using functions that extracts specific characters (e.g. .,#!?) from a text file. It should remove all the specific characters and replace them wi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site