Created
September 27, 2017 17:04
-
-
Save meggangreen/5410a1af84017faabaa0d6dae93b2cee to your computer and use it in GitHub Desktop.
green_translator.py created by meggangreen - https://repl.it/Li9Z/2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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