Question: Write a function encoding that takes a string and an integer as the parameters, and returns a new string, so that at each position, the
Write a function encoding that takes a string and an integer as the parameters, and returns a new string, so that at each position, the two characters in the string and the new string are the integer number of positions away from each other in the ASCII character encoding table. Then swap the two half-strings. For example, encoding('ABCabc..10) should return the new string "WXY789". Please write this in Python3 language.
Step by Step Solution
3.37 Rating (147 Votes )
There are 3 Steps involved in it
PROGRAM def encodingstring num Defining function to encode the string newstr Creating ... View full answer
Get step-by-step solutions from verified subject matter experts
