Question: Write a program with a function def repeat (string, n, delim) that returns the string string repeated n times, separated by the string delim
Write a program with a function def repeat (string, n, delim) that returns the string string repeated n times, separated by the string delim (ex. space, ?, #, etc). Ex: If the input is: Enter a string: hello. How many repetitions? 5 Separated by? # then the output is: hello#hello#hello#hello#hello Your program will also need a main function to receive input, call the function, and output the results.
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
mainpy 1... View full answer
Get step-by-step solutions from verified subject matter experts
