41.4k views
5 votes
Could anyone help :)

Could anyone help :)-example-1

1 Answer

3 votes

Answer:

2

Step-by-step explanation:

This code segment iterates through the array checks to see if each element equals y if so, increments the counter variable count

Essentially, this code is taking in two parameters an array x and an integer y and counting the number of times y appears in the array x

look(numList, 1) counts the number of times the integer 1 appears in numList

1 appears two times and therefore 2 is the value returned by the function and therefore the answer

User Kousic
by
7.5k points