(Solved): python Use the function design recipe to develop a function named repeat_separator. The functi ...
python
Use the function design recipe to develop a function named repeat_separator. The function header (with missing type annotations) is: repeat_separator(word, sep, \( n \) ). Parameters word and sep are strings containing at least one character. Parameter \( n \) is a positive integer. The function returns a long string consisting of \( n \) occurrences of word, separated by the separator string sep. Examples: - repeat_separator("Word", "X", 3) returns "WordXWordXWord" - repeat_separator("This", "And", 2) returns "ThisAndThis" - repeat_separator("This", "And", 1) returns "This"
Your function must have exactly one loop. Your function definition must have type annotations and a complete docstring. Use the Python shell to test repeat_separator.