Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

python Part II: Drop Every n-th Element (2 points) Write a recursive function dr

ID: 3820655 • Letter: P

Question

python

Part II: Drop Every n-th Element (2 points) Write a recursive function drop that takes a non-empty list of integers and a positive integer n as its argu ments, and returns a new list formed by dropping every n-th item from the original list. You may assume that n 1. Your function must be recursive and must not use any loops. Examples: Function Call Return Value drop ([0, 1, 2, 3, 4, 5, 6, 7, 8] 3) 0 1, 3, 4, 6, 7] drop (12, 4, 6, 8, 10, 12, 141, 2) [2, 6, 10, 14 drop 8 6, 71, 4) [8, 6, 7]

Explanation / Answer

del nums [idx]