Assignment 6

Due Thurs, Oct 25

Please create a single file named hw6-1.py and email it to kay <at> ischool. Include comments stating your name, the names of any collaborators, and approximate time it took you to complete the exercise.


1. Simple Translation

Finish the translation exercise from the class code:

##A short translation script

y = { "Paul" : "Pawel", "likes":"lubi", "computers" : "komputery" }
print("A dictionary for translating:",y)


msg = "Paul really likes to program computers"
m_list = msg.split() #creates a list of words

## Add code to check if each word in m_list is in y.
## If it is, replace it with its value in y.

msg= " ".join(m_list) #glues a list of strings back together
print(msg)