Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Physics

Authors: James S. Walker

5th edition

978-0133498493, 9780321909107, 133498492, 0321909100, 978-0321976444

More Books

Students also viewed these Programming questions

Question

=+d. Only the plant at site 1 is completed by the contract date.

Answered: 1 week ago