logo

Crowdly

What is the purpose of this function?  def cipher(my_array): sherlock = my_a...

✅ 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

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!