DON'T USE NUMPY Write a python code: For every 3 numbers if 2 numbers are over the threshold of 3, return True. If for e

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

DON'T USE NUMPY Write a python code: For every 3 numbers if 2 numbers are over the threshold of 3, return True. If for e

Post by answerhappygod »

DON'T USE NUMPY Write a python code: For every 3 numbers if 2numbers are over the threshold of 3, return True. If for everythree numbers if less than 2 numbers are over the threshold returnfalse. create a list1 for the return bool. Create another list2,for every 3 numbers if they return back true, return the positionof the first index value, as the first value in list2, and thelength of the list(aka how many numbers are over the threshold), asthe second value of the list. (List within a list) For example:data=[2,2,3,4,3,4,5,4,6,6,4,5,2,3,1,5,10,12,4,5,6,2,21,1] Excptedoutput= [False, True, True, True, False, True, True, False] list2 =[[1, 3],[5,2]] DON'T USE NUMPY
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply