Ask Question
12 December, 03:52

Write the definition of a function, is_reverse, whose two parameters are arrays of integers of equal size. The function returns true if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.)

+3
Answers (1)
  1. 12 December, 03:54
    0
    def is_reverse (lst1, lst2):

    lst2 = lst2[::-1]

    if lst1 = = lst2:

    return True

    else:

    return False

    Explanation:

    Create a function called is_reverse that takes two parameters, lst1 and lst2

    Reverse the second list using slicing

    Check if the first list and the second list are equal to each other. If they are, return True. Otherwise, return False
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the definition of a function, is_reverse, whose two parameters are arrays of integers of equal size. The function returns true if and ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers