<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_block_string(txt):
 """Return a string formatted as a python block comment string, like the one you're currently reading. Special characters are escaped if necessary. """

    import json

    lines = []
    for line in txt.split('\n'):
        line_ = json.dumps(line)
        line_ = line_[1:-1].rstrip()  # drop double quotes
        lines.append(line_)

    return '"""\n%s\n"""' % '\n'.join(lines)