Python
Write a recursive function called “is_mirror“which takes THREE input values:
- a list of numbers
- the index position of the first item in thelist
- the index position of the last item in thelist
Your function should return True if the valuesbetween (and including) the first and last indexpositions form a “mirror”.
Answer
def is_mirror(numbers, first, last): if first < last: if numbers[first] != numbers[last]: return False return is_mirror(numbers, first + 1, last – 1)
OR
OR