def parse_task(line):
    """
    Receives a line and parses it to match the format `[subject] name`, where `subject` is a two-letter code for the subject and `name` is the name of the task.

    If `subject` is invalid, the user is re-prompted until a valid entry is given. Capitalisation is automatic.

    Args:
        line: A line to parse a task from.

    Returns:
        A string with the format `[subject] name`, explained above.
    """
    subject, name = line.split(" - ")
    print("Parsing {}...".format(line))

    while not subject.isupper() or not len(subject) == 2:
        subject = input("The subject {} does not meet your standarised format. What should be the corrected term? ".format(subject)).upper()

    return "[{}] {}".format(subject, name)