✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the purpose of this function?
def cipher(my_array):
sherlock = my_array[0]
watson = my_array[-1]
moriarty = 0
for villain in my_array:
if villain > sherlock:
moriarty += 1
elif villain < watson:
watson = villain
return sherlock, moriarty
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!