[Tutor] Dictionary

Selby Rowley-Cannon selbyrowleycannon at ymail.com
Sun Jun 17 20:26:25 CEST 2012


Version: 2.7

OS: Ubuntu 12.04 LTS


I am writing a small translation app for Rydish (A language that exists in the same way Klingon does, invented by my company for a[n] RPG).
Here is my current method of translation:

Edictionary = {'English keys':'Rydish values'}
TextEng = raw_input('Please enter your text: ')
if TextEng in Edictionary:
    print(TextEng + ' traslates to ' + Edictionary[TextEng])

But I have found that this is only going to translate one word at a time. I thought about a loop of somesort, but I can't seem to find one that won't still force the user to translate one word at a time. Can anyone tell me how to translate a full sentance/several sentances?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120617/1318bf31/attachment.html>


More information about the Tutor mailing list