Question: Write a function called findNumber that takes a list and a number as parameters. The function returns a new list containing the positions in

Write a function called findNumber that takes a list and a number

 

Write a function called findNumber that takes a list and a number as parameters. The function returns a new list containing the positions in the argument list where the number was found. The function returns an empty list if the number was not found. For example: If the list that is passed to the function contains [2, 4, 1, 2, 3, 2, 71 and the number we are looking for is 2. The call to findNumber should return the list [0, 3, 5]. That is, the number 2 was found in positions 0, 3 and 5 in the list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python function called findNumber that does wh... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!