Question: please use python Write a program that asks for a strings and a number n as input from the user. The program should then output
please use python Write a program that asks for a strings and a number n as input from the user. The program should then output a new string in which the first n characters of s are replicated n times. For example, if s-"abcdefg" and n=2. then the new string will be "ababcdefg". Assume that n will be smaller than the length of the string. See the following for more sample runs of the program: >>> import PA3 solution Give the string: abcdefg Give the number: 3 The new string is: abcabcabcdefg >>> PA3_solution.main() Give the string: abcdefg Give the number: 4 The new string is: abcdabcdabcdabcdefg
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
