Python
Programming Exercises, Gently Explained
128
the bottom of your solution program. Your solution is correct if the following assert statements’
conditions are all True:
assert rot13('Hello, world!') == 'Uryyb, jbeyq!'
assert rot13('Uryyb, jbeyq!') == 'Hello, world!'
assert rot13(rot13('Hello, world!')) == 'Hello, world!'
assert rot13('abcdefghijklmnopqrstuvwxyz') == 'nopqrstuvwxyzabcdefghijklm'
assert rot13('ABCDEFGHIJKLMNOPQRSTUVWXYZ') == 'NOPQRSTUVWXYZABCDEFGHIJKLM'
Try to write a solution based on the information in this description. If you still
have trouble
solving this exercise,
read the Solution Design and Special Cases and Gotchas sections for
additional hints.
Prerequisite concepts: strings, ord(), chr(), for loops, Boolean operators, islower(),
isupper()
, augmented assignment
operators
Dostları ilə paylaş: