Question: I need a hand with my lab, if someone could help me, Id appreciate it. Question 1 10 marks] Write a function find valuepos(Alist, base)

I need a hand with my lab, if someone could help me, Id appreciate it.
 I need a hand with my lab, if someone could help
me, Id appreciate it. Question 1 10 marks] Write a function find

Question 1 10 marks] Write a function find valuepos(Alist, base) that returns the position of the smallest value in the list Alist and this smallest value is larger than base. The function will return 1 if there is no value larger than base. Note, do not sort tsst. You should be able to solve this problem going through the list only once. Use this function in a main program as fo values to a list. For example follows. First your main progranm should assign L = [4-1, 52, 17, 81,-2, 75, 24] The main program should then print the list. Then the main program should call the above function appropriately in order to print the smallest numbers from the list that are greater than 0, 25, 50, 75 and 100 respectively using the format below. If there is no value larger than one or more of these numbers, then the program print an appropriate message as indicated below. Remember that the TAs will potentially change the list (and its size) in order to test your program so your program must be general for different list values and sizes For the example list given above, the output should be the following [4,-1, 52, 17, 81,-2, 75, 24)] The smallest number greater than 0 is 4 The smallest number greater than 25 is 52 The smallest number greater than 50 is 52 The smallest number greater than 75 is 81 There are no numbers greater than 100 in this list Another example if L is assigned values as follows L = [1,-3, 50, 84, 39, 13, 5] The output would be [1,-3, 50, 84, 39, 13, 5] The smallest number greater than 0 is 1 The smallest number greater than 25 is 39

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!