FMc answer is great, but I would to something different, a bit more pythonic:
translations = {"Dog":"Hund", "Hello":"Hallo"}
eng = "sample"
while eng:
eng = input("Word: ")
if not eng in translations:
print("Unknown word")
else:
print (German: translations[eng])
First of all, we use the built-in dictionary; it's the same the FMc used, but it's less wordier.
The 'eng' is avaliated to False when it's empty ("") or None. Then we check if the word is on the dict. If it isn't, we say the word is unknown, if it's, we print the correspondent key, also known as translated word.
You can easily turn it into a function:
def translator(translations, language):
eng = "sample"
while eng:
eng = input("Word: ")
if not eng in translations:
print("Unknown word")
else:
print (language + ": " + translations[eng])
With it, you just have to pass a dictionary of translation and the name of your language.
For instance:
translator({"Dog":"Cachorro","Hello":"Ola"},"Portuguese")
The eng = "sample" line is not so beautiful, but it works; you can try a different way so you can eliminate this line and still use eng in the while loop.