Skip to content

Instantly share code, notes, and snippets.

@meggangreen
Created September 27, 2017 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meggangreen/5410a1af84017faabaa0d6dae93b2cee to your computer and use it in GitHub Desktop.
Save meggangreen/5410a1af84017faabaa0d6dae93b2cee to your computer and use it in GitHub Desktop.
green_translator.py created by meggangreen - https://repl.it/Li9Z/2
engtoesp = {
"hello": "hola",
"coffee": "cafe",
"milk": "leche",
"sugar": "azucar",
"doggie": "perrito",
"kitty": "gatito",
"niece": "sobrina",
"sister": "hermana",
"auntie": "tia",
"grandma": "abuela"
}
def translate(english,dictionary) :
if ( english in dictionary ) == True:
espanol = "Espanol: %s\n" % (dictionary[english])
else :
espanol = "no conozco esta palabra\n"
return espanol
print translate("kitty",engtoesp)
print translate("granddaughter",engtoesp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment