
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
***python python ***
Write a function encoding() that takes a string and an integer as the parameters, and returns an encoded string.
The encoding is performed as follows. First, the given string is splited into two sub-strings, where characters at even poisitions is in one sub-string, characters at odd positions are in
the second sub-string. The two sub-strings are then put together, even character string first. Then, each character c is replaced by the character c' that is located the given integer
number of positions away from c in the ASCII character encoding table.
For example:
encoding('ABCabc' ,-10)
should return the new string '79X8WY'.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- How to write a function in python that takes a string s = kkeeepinng and returns the non-repeating character from strrint s. Such that the output should be as follows: p i garrow_forwardWrite a function to find the best exchange rate from one currency to another currency: Given list of inputs such as [['USD', 'JPY', 110], ['USD', 'AUD', 1.45], ['JPY', 'GBP', 0.0070]] Write a function in python called convert which will get you the best conversion from one input to another and print out the path to reach it. Ex: convert('GBP', 'AUD'), will return the best conversion rate and the path it took to reach.arrow_forwardWrite a function my_der_calc(f,a,b,N,option), with the output as [df,X],where f(x) is a function that equals x(1-x), a and b are a scalars that represent the 1st and last point of your grid respectively, and Nis an integer that represents the number of grid points, and optionis the string that can take on the text forward, backward or central differencing. Thus, you are writing a function that can perform forward, backward or central differencing, the choice is determined by the input option Let xbe an array starting at a, ending at b, containing Nevenly spaced elements, and let y be the array f(x) The output argument, df, should be the numerical derivatives computed for xaccording to the method defined by the input argument, option The output argument Xshould be an array that is the same size as df containing the points in xfor which df is valid Remember, the forward difference method “loses” the last point, the backward difference method loses the first point, and the central…arrow_forward
- Define a function named get_encrypted_list (word) which takes a word as a parameter. The function returns a list of characters. The first element is the first letter from the parameter word and the rest is as a sequence of '*', each '*' representing a letter in the parameter word. Note: you can assume that the parameter word is not empty. For example: Test Result ['h', '*', **1 guess = get_encrypted_list('hello') print(guess) print (type (guess)) guess = get_encrypted_list('succeed') ['s', '*', print (guess) **¹, ¹*¹] **']arrow_forwardCan u code it in Pythonarrow_forward*Code in Python A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the bits in the string 1011 two places to the left to produce the string 1110. Note that the leftmost two bits are wrapped around to the right side of the string in this operation. Define two scripts, shiftLeft.py and shiftRight.py, that expect a bit string as an input. The script shiftLeft shifts the bits in its input one place to the left, wrapping the leftmost bit to the rightmost position. The script shiftRight performs the inverse operation. Each script prints the resulting string. An example of shiftLeft.py input and output is shown below: Enter a string of bits: Hello world! ello world!H An example of shiftRight.py input and output is shown below: Enter a string of bits: Hello world! !Hello worldarrow_forward
- Define a function named get_encrypted_list (word) which takes a word as a parameter. The function returns a list of characters. The first element is the first letter from the parameter word and the rest is as a sequence of '*', each '*' representing a letter in the parameter word. Note: you can assume that the parameter word is not empty. For example: Test Result ['h', ¹*¹ **', '*'] *** guess = get_encrypted_list('hello') print (guess) print (type (guess)) guess = get_encrypted_list('succeed') ['s', '*', print (guess) **']arrow_forwardComplete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the substr() function to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990. Ex: If the input is: March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1 then the output is: 3/1/1990 12/13/2003 main.cpp #include <iostream>#include <string> using namespace std; int DateParser(string month) {int monthInt = 0;if (month == "January")monthInt = 1;else if (month == "February")monthInt = 2;else if (month == "March")monthInt = 3;else if (month == "April")monthInt = 4;else if (month == "May")monthInt = 5;else if (month == "June")monthInt = 6;else if (month == "July")monthInt = 7;else if (month == "August")monthInt = 8;else if (month == "September")monthInt = 9;else if (month == "October")monthInt = 10;else if (month ==…arrow_forward2. Implement function date that takes 4 inputs: a non-abbreviated weekday (as a string) a non-abbreviated month (as a string) a day in the month (a an integer) a year (as an integer) Function date() should return the complete date (as a string) using 3-characterabbreviations for the weekday and month and using the format shown below>>> date('Tuesday', 'October', 20, 2014)'Tue, Oct 20, 2014'>>> date('Thursday', 'May', 1, 2014)'Thu, May 1, 2014'arrow_forward
- : Given a string, write a function to check if it is a permutation ofa palindrome. A palindrome is a word or phrase that is the same forwards and backwards. Apermutation is a rearrangement of letters. The palindrome does not need to be limited to justdictionary words.EXAMPLEInput: Tact CoaOutput: True (permutations: "taco cat'; "atco eta·; etc.)arrow_forwardCan someone help me with the python code for this question?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education