Question: pls debug accordingly python Write a function is_num_str_List () that expects a parameter aain_List (a list) The function checks if each element of the list

pls debug accordingly
python
 pls debug accordingly python Write a function is_num_str_List () that expects
a parameter aain_List (a list) The function checks if each element of
the list is a string with a proper integer or float by
calling the helper function is_num() (see above). The function should return False
if the main_. List is empty. A Since this is one of
the requirements of the function, you need to ensure that you implementit.
How would you write an as sert to test it? The example
below guides you step-by-step thyough the process if you understand what needs

Write a function is_num_str_List () that expects a parameter aain_List (a list) The function checks if each element of the list is a string with a proper integer or float by calling the helper function is_num() (see above). The function should return False if the main_. List is empty. A Since this is one of the requirements of the function, you need to ensure that you implementit. How would you write an as sert to test it? The example below guides you step-by-step thyough the process if you understand what needs to happen and how to accomplish it, then you can go directly to writing your function and testing it with the assert statements Walkthrough Given a sample list [11 ', ' 2 ', 3], let's store it as a sample_list Since our function needs to check that each element of the list is a string. let's loop over each item and display its side: for item in sample_1ist: print(item, "is of type", type(item)) Notice that inside of our function, if type(item) !=str, then we'd need to return False. We also know, that if we didnt trigger that return, the element stored in item is a string, which we can check using is_num(). This means that the basic structure of our function body is as followsi for item in ...: t check each element of the provided parameter if type (item) I- ...: return False if is num(item) =- False: + call the helper function and check if it returned False return False return .... I if none of the above returns got triggered, we have a numerio string as each element - Note that the function should not return True until it has gone through every element of the list. Hint - Remember to check the edge cases. What should happen if the list is empty? When done developing your program, press the Submit for gradin your program for auto-grading. ding trail of your work 2/21T12null0,7,12min:9 Latest submission - Invalid date on Invalid date Only show failing tests ( 3 tests hidden) 2:Unit test Testing the provided assert statements + an edge case We got a return value Test feedback True instead of Instructions is_num0 Write a function is_num() takes a string and checks ifit represents a number (either an integer or a decimal) def ia nur (ral): The function chocks if 'val' is a string: returns False if 'val' is not a string. Otherwise, returns True if the string 'val' contains a valid integer or a fioat. Returns False otherwise. "In" pass Write the initial tests that verfy y ts accuracy. For example, \[ \begin{array}{l} \text { assert (1s_num("6.7")) } \\ \text { assert (not is_num("12r9")) } \end{array} \] isnumstr_list0 Write a function is_num_str_List () that expects a parameter main_List (a ist). The function checks if esch element of the ist is a string with a proper integer of foat by caling the heper function is num() (see above). The function should retum False if the main_list is empty. A Since this is one of the requiements of the function, you need to ensure that you implement it. How would you write an assert to test it? The example below gudes you step-by-step through the process. If you understand what needs to happen and how to accomplish it, then you can go directly to witing your function and testing it with the assert sta:ements. Walkthrough Given a sample list [' 1,2,3], let's store it as a sample_list. Since our function needs to check that each element of the list is a string. let's loop over each item and display its side. for item in aample_1ist: print(iten, "I jof type", type(item)) Notice that inside of our function, if type (1tee) I=str, then wed need to return Fa se. We also know, that if we didnt thigger that return, the element stored in item is a string, which we can check using is_num (). This means that the basic structure of our function body is as follows: for item in ... A cheok each element of the provided parameter if cype (item) I= : return False if is num(item) = False: A call the helper function and check if it returned False return False return.... \# if none of the above returns got triggered, we have a numeric string as each - Note that the function should not return True until it has gone through every element of the list. Hint - Remember to check the edge cases. What should happen if the list is empty? When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading. Coding trail of your work What is this? 2/2 Latest submission - 9:56 PM PST on 02/21/23 Total score: 12/17 Only show failing tests Download this submission 2.Unit test 0/5 Testing the provided assert statements + an edge case We got a return value Test feedback True instead of

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!