Question: You worked late into the night on an assignment and didnt realize that you wrote a huge section of your term paper with your fingers
You worked late into the night on an assignment and didn’t realize that you wrote a huge section of your term paper with your fingers on the wrong keys. Where you meant to type: “This is an unruly mob.” You actually typed:
“Ty8s 8s ah 7hr7o6 j9b.”
Basically you swapped: 6 for Y, 7 for U, 8 for I, 9 for O, 0 for P, U for J, I for K, O for L, H for N, and J for M. (Those were the only keystrokes you got wrong—you caught yourself before you got much further.)You also never touched the shift key, so it’s only lowercase letters that you care about.
Knowing Python as you do, you decide to write a quick program to fix your text. Write a function fixItUp that takes a string as input and returns a string with the characters put the way that they ought to have been.
Step by Step Solution
3.32 Rating (161 Votes )
There are 3 Steps involved in it
def replaceCharactersstring newString newString new newString newString strin... View full answer
Get step-by-step solutions from verified subject matter experts
