In order to collaborate with the participants of our course, I have developed these 3 simple exercises -away from the usual mathematical style- to practice the course content with the tools seen from week 1 to 4. I hope you enjoy it!
Mirror Mirror
1.
Make a program in Pyhton that given a phrase,
convert it in to their mirror image.
Input: “Hello World”
Output: “dlroW olleH”
2.
Make a program that given a phrase and a integer
number, convert it in to their shifted image. The number must be in the
range [1-length(phrase)]
Input: “Hello World”, 3 / “This
is a simple sample”, 7
Output: “lo WorldHel” / “ a
simple sampleThis is”
3.
Make a program that given a phrase and a integer
number, convert it in to their mirror shifted image (Nightmare level). The
number must be in the range [1-length(phrase)]
Input: “Hello World”, 4 / “This is a simple sample”, 7
Output: “lleHdlroW o”
/ “si sihTelpmas elpmis a”