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
Step: 1
PROGRAM def encodingstring num Defining function to encode the string newstr Creating ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Physics
Authors: James S. Walker
5th edition
978-0133498493, 9780321909107, 133498492, 0321909100, 978-0321976444
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App