with open('your_filename_here', 'r') as fp:
    string = fp.read()
f1 = open('your_filename_here', 'w')
rx = re.compile(
    """
                (?!^[A-E]\\.)
                (?P<question>.+[\\n\\r])
                (?P<choices>[\\s\\S]+?)
                ^ANSWER:\\ (?P<answer>[A-E])
                """
    , re.MULTILINE | re.VERBOSE)
rq = re.compile('^[A-E]\\.\\ (?P<choice>.+)')
for match in rx.finditer(string):

    def repl(line, answer):
        if line.startswith(answer):
            line = rq.sub('*\\1', line)
else:
    line = rq.sub('\\1', line)
return line
lines = [repl(line, match.group('answer')) for line in match.group(
    'choices').split('\n') if line]
block = match.group('question') + '\n'.join(lines)
f1.write(block + '\n\n')
to convert a MCQ in the required format - python