1 e2g_dict = {'a':'ein', 'is':'ist', 'test':'Test', 'this':'dies'}
2
3 # Englisch nach Deutsch uebersetzen
4 def translate(english):
5 return e2g_dict[english]
6
7 esentence = 'this is a test'
8 elist = esentence.split()
9 glist = []
10
11 for eword in elist:
12 glist = glist + [translate(eword)]
13
14 gsentence = " ".join(glist)
15
16 print gsentence