def _quiz(wordlist, quiz_length):
    'Runs a command line quiz of the specified length.'
    pd.options.mode.chained_assignment = None
    (answered, correct) = (0, 0)
    for (word, gender) in wordlist.get_words(quiz_length):
        guess = input(f'What is the gender of {word}? ').lower()
        if (guess in ('quit', 'exit')):
            break
        answered += 1
        try:
            guess = wordlist.format_gender(guess)
        except ValueError:
            print('Unrecognised guess, skipping.\n')
            continue
        accurate = (gender == guess)
        wordlist.update_weight(word, accurate)
        if accurate:
            print('Correct!\n')
            correct += 1
        else:
            print(f'''Incorrect! The correct gender is {gender}.
''')
    return (correct, answered, (answered == quiz_length))
Runs a command line quiz of the specified length.
def _quiz(wordlist, quiz_length):
    
    pd.options.mode.chained_assignment = None
    (answered, correct) = (0, 0)
    for (word, gender) in wordlist.get_words(quiz_length):
        guess = input(f'What is the gender of {word}? ').lower()
        if (guess in ('quit', 'exit')):
            break
        answered += 1
        try:
            guess = wordlist.format_gender(guess)
        except ValueError:
            print('Unrecognised guess, skipping.\n')
            continue
        accurate = (gender == guess)
        wordlist.update_weight(word, accurate)
        if accurate:
            print('Correct!\n')
            correct += 1
        else:
            print(f'Incorrect! The correct gender is {gender}.
')
    return (correct, answered, (answered == quiz_length))