An Xfinity service diagnostic tool stores ordered event codes in a Python list. To support a processing mode used by Comcast test automation, reverse the order of events within every consecutive group of k elements.
Modify the list in place and return the same list. If the final group contains fewer than k elements, leave that final group unchanged.
Implement reverse_in_groups(items, k).
items, a list of integers, and k, a positive integer.k consecutive elements reversed.def reverse_in_groups(items, k):