Some pythonic advice needed

Andrei see at my.signature.com
Sun Jun 1 10:03:47 EDT 2003


Have you considered putting more than one answer in the dictionary entry
of the latin word? You could use a list of translations for it rather
than a single answer string, something like this:

mydict = {"latinword": ["dutch1", "dutch2"]}

combined with:

if answer in mydict["latinword"]: ....

I don't know if you need reverse translation too, that would be a bit
harder but you could build a reverse dictionary from the latin-dutch
one without any database which seems overkill unless you have huge
amounts of words.

--
print "znvy: cebwrpg5 at bcrenznvy.pbz
Fcnzserr! Cyrnfr qb abg hfr va choyvp zrffntrf. V ernq gur yvfg, ab arrq gb PP.".decode("rot13")


Posted via http://dbforums.com




More information about the Python-list mailing list