<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prompt_4_mfa_code(activate = False, input = None):
 """ Prompt for an MFA code :param activate: Set to true when prompting for the 2nd code when activating a new MFA device :param input: Used for unit testing :return: The MFA code """

    while True:
        if activate:
            prompt_string = 'Enter the next value: '
        else:
            prompt_string = 'Enter your MFA code (or \'q\' to abort): '
        mfa_code = prompt_4_value(prompt_string, no_confirm = True, input = input)
        try:
            if mfa_code == 'q':
                return mfa_code
            int(mfa_code)
            mfa_code[5]
            break
        except:
            printError('Error: your MFA code must only consist of digits and be at least 6 characters long.')
    return mfa_code