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

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
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. Kelly Lyons

Link to this Page