Replace middle element of odd-length tuple with n copies. Example: (1,2,3,4,5), n=3 => (1,2,3,3,3,4,5)
Implement this function:
def replace_middle_with_n_times_middle(t: tuple, n: int) -> tuple:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: t, n.
Input
(1, 2, 3, 4, 5)
3
Output
(1, 2, 3, 3, 3, 4, 5)