Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.


This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

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