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
-
- 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
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