You are not allowed to use numpy for this question. Your task is to write a Python function q2_funct with the following

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

You are not allowed to use numpy for this question. Your task is to write a Python function q2_funct with the following

Post by answerhappygod »

You Are Not Allowed To Use Numpy For This Question Your Task Is To Write A Python Function Q2 Funct With The Following 1
You Are Not Allowed To Use Numpy For This Question Your Task Is To Write A Python Function Q2 Funct With The Following 1 (120.61 KiB) Viewed 41 times
Need urgently will upvote please do it within 1 hour
You are not allowed to use numpy for this question. Your task is to write a Python function q2_funct with the following def line: def q2_func (a_list, b_list, max_gap): where . The input a_list is a Python list of integer values. The input b_list is a Python list of integer values. You can assume that the length of a_list is equal to the length of b_list. The input max_gap is an integer value. The function is required to return a list of two lists (see below for explanation). . We will use the following example to illustrate what you need to do to implement the required function. Assuming that the input values are: = a_list [23, 56, 12, 91, 67] b_list = [18, 64, 12, 85, 58 ] gap = 7 The expected output is the list of two lists: [[56, 67], [64, 58]] The function calculates gaps between the corresponding values in a_list and b_list. For example, Gap between 23 and 18 is 5 Gap between 56 and 64 is 8 Gap between 12 and 12 is 0 Gap between 91 and 85 is 6 Gap between 67 and 58 is 9 The function selects gaps that are great than a given max_gap, and generates the output list consisting of two lists. The first list contains values from a_list and the second list contain values from b_list, as shown above. If there is no gap that is greater than a given max_gap, the function returns an empty list. If both the a_list and b_list are empty lists, the function returns an empty list.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply