Welcome to CS1315. Click on the python to add comments.
This page removed for FERPA compliance
Midterm Exam 2 Review Spring 2005: Encoding and Decoding
Post your answers, questions, comments, comments on answers, suggestions, suggestions on questions, etc.
Back to
Spring2005 Midterm 2 Review
a)
def replaceString(string):
tarString=string.replace('e', '#').replace('i', '!').replace('a', '@').replace('o', '%').replace('u', '^').replace('r', '-').replace('s', '=').replace('t', ':')
print tarString
return tarString
b)
def decode(string):
decodedString=string.replace('#', 'e').replace('!', 'i').replace('@', 'a').replace('%', 'o').replace('^', 'u').replace('-', 'r').replace('=', 's').replace(':', 't')
print decodedString
return decodedString
how do we excute these?
Make a string. Then run the function on them.
Student1594
Link to this Page
Spring2005 Midterm 2 Review
last edited on 14 March 2005 at 5:19 pm by lawn-199-77-212-42.lawn.gatech.edu