Latin Vocab Quizzes

I needed some help focusing on my Latin last night, so I wrote this script, along with a dictionary of the stage, to help me study:

def print_tuple(words):
    string = '"'
    for word in words:
        string += word + '" or "'
    return string[0:-6]+'"'

def quiz (words, shuffle=True):
    print 'Beginning Vocab Quiz!
'
    
    keys = words.keys()
    if shuffle:
        import random
        random.shuffle(keys)
    
    wrong = {}
    
    for word in keys:
        print '%s:' % (word,),
        entered = raw_input().lower()
        while True:
            # Remote to
            if entered[0:2].lower() == 'to': entered = entered[0:3]
            
            if words[word].__contains__(entered): break
            elif entered.find('skip') > -1 or len(entered) == 0:
                print 'The word meant %s' % (print_tuple(words[word]),)
                wrong[word] = words[word]
                break
            else:
                print 'Try again!
%s:' % (word,),
                entered = raw_input().lower()
    
    if len(wrong) > 0:
        print '
You got some wrong. Try those again (y/n)?',
        if raw_input().lower()[0] == 'y': quiz(wrong, shuffle)
    else:
        print '
You\'re done and got them all right! Start again (y/n)?',
        if raw_input().lower()[0] == 'y': quiz(words, shuffle)

words = {
    # Section 31 Vocab
    
    # Mostly Nouns
    'dux, ducis': ('leader', 'general'),
    'patronis, -i': ('patron',),
    'cliens, clientis': ('client',),
    'praeco, -onis': ('herald',),
    'vultus, -um': ('expression', 'face',),
    'libertus, -tatis': ('freedom',),
    'avis, avis': ('bird',),
    'fraus, fraudis': ('trick',),
    'tempus, temporis': ('time',),
    'mos, moris': ('habit','custom',),
    'casus, -us': ('misfortune',),
    'superbus, -a, -um': ('proud', 'arrogant',),
    'pauper': ('poor', 'poor man',),
    'adverus, -a, -um': ('hostile','unfavorable',),
    'idem, eadem, idem': ('the same',),
    'quidam, quaedam, quodam': ('a certain',),
    
    # Mostly Verbs
    'volvo, volvere, volvi, volutus': ('turn',),
    'in animo volvere': ('wonder',),
    'praeterio, praeterire': ('pass by','get past',),
    'oro, orere': ('beg','plead',),
    'veho, vehere, vexi, vectus': ('carry', 'ride',),
    'spero, sperare': ('hope',),
    'appello, appellare': ('call by name','call out to',),
    'effendo, effendere, effundi, effusus': ('pour out',),
    'ignosco, ignoscere, ignovi, ignotus': ('forgive',),
    
    # Other Stuff
    'identidem': ('again',),
    'ne... quidem': ('not even',),
    'ubique': ('everywhere',),
    'haudquaquam': ('not at all','in no way',),
    're vera': ('trully','really','in fact',),
    'quia': ('since','because'),
    'nihilominus': ('nevertheless',),
    
    # Nasty Neuters
    'iter, iteneris': ('journey','route',),
    'nomen, nomenis': ('name',),
    'caput, capitis': ('head',),
    'corpus, corporis': ('body',),
    'flumen, flumenis': ('river',),
    'opus, operis': ('work',),
    'vulnus, vulneris': ('wound',),
    'carmin, carminis': ('song', 'poem',),
    'onus, oneris': ('load','burden',),
    'fulmen, fulminis': ('thunderbolt',),
}

# Start quizzing
quiz(words)

Usage is rather self-explanitory… :stuck_out_tongue: