Question: process _ number _ list ( num _ list, k ) : o Parameters: This function takes two parameters: num _ list - a list

process_number_list(num_list, k): o Parameters: This function takes two parameters: num_list - a list of numbers (integers). k - an integer specifying which element from the start and end of the sorted list should be considered as the k-th largest and smallest number. o Functionality: The function should return a list containing the k-th largest and k-th smallest number from the list. If k is out of bounds (greater than the length of the list, or non-positive), the function should return None. If the list contains duplicate values, the function must treat them as if they only appeared once. That is, it should behave as if the list contains only unique values. Negative numbers and zero in the list should also be considered as out-ofbounds conditions, and the function should return None if they exist. o Edge Cases: The function should handle scenarios where the list is too small or the value of k is too large or non-positive by returning None. Example: If k =3 but the list contains only 2 distinct elements, the function should return None. code it in pyhton

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 Programming Questions!