#Example code for lesson 2 #You need tto write your own lists and create a function which lets #enter an English phrase, and the function returns the Chinese equivalent # English -> Chinese # Hello = Ni Hao # Goodbye = Zai Jian # Thank you = Xie Xie # Good Morning = Zao An # Good Night = Wan An #You need to add "Can I play football with you" #The mandarin equivalent of this is: "Wo ke yi he ni ti zhu qiu" englishPhrases = ["Hello","Goodbye","Thank you","Good Morning","Good Night"] chinesePhrases = ["Ni Hao","Zai Jian","Xie Xie","Zao An","Wan An"] def englishToChinese(): Uinput = raw_input("Enter a phrase in English:") print "You entered", Uinput #Now do something with this! index = 0 for phrases in englishPhrases: if phrases == Uinput : print "In Chinese, this is:", chinesePhrases[index] index = index + 1 englishToChinese()