Question: process _ number _ list ( num _ list, k ) : o Parameters: This function takes two parameters: num _ list - a list
processnumberlistnumlist, k: o Parameters: This function takes two parameters: numlist 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 kth largest and smallest number. o Functionality: The function should return a list containing the kth largest and kth smallest number from the list. If k is out of bounds greater than the length of the list, or nonpositive 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 outofbounds 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 nonpositive by returning None. Example: If k but the list contains only 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
