Question: Program Requirements ( 1 2 Marks ) The requirements of the system are given below. Please ensure that your functions have the EXACT naming as
Program Requirements Marks
The requirements of the system are given below. Please ensure that your functions have the EXACT naming as specified! Failure to do so will result in lost marks. You can choose to copy and paste the function names into the implementation cell to avoid spelling mistakes.
Note: you must include a try and except statement in at least two functions in your code.
Define a function selectionsortnums:
nums: A list of floats.
Return: A sorted copy of the list nums using the selection sort algorithm.
Note: Make sure that you sort a copy of the list. DO NOT modify the original list. You can create a copy of nums by writing the code newarr nums.copy In addition, marks will not be given if the selection sort algorithm is not used. Pseudocode of the selection sort sorting algorithm is provided above in the Background section.
Define a function extracttempstemps:
temps: A list of strings representing a set of daily temperatures.
Return: A list of numeric items that represent, where applicable, each element in temps converted to a float
Note: Some of the items in temps cannot be represented as a float. These items should be ignored. Refer to the background section as an example
Define a function calculatemediannums:
nums: A list of sorted floating numbers.
Return: A float representing the median of nums.
Hint: If the length of a sorted list is odd then the median exists at index n where n is the length of the list and represents integer division. If the length of a sorted list is even, the median is calculated by the average of the two most middle elements. One of these elements exists at index n can you figure out the other one? For example, the median of is
Define a function maintempdata:
tempdata: A list of strings representing a set of daily temperatures.
Return: A float representing the median of nums. Return the string NA if an error occurs.
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
