Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Basic python class. Create a function using a for loop to count number of times a number less than or equal to 33 occurs. Test
Basic python class.
Create a function using a for loop to count number of times a number less than or equal to 33 occurs. Test function on the following numpy array.
random_list = np.array([19, 29, 33, 34, 30, 32, 42, 40, 35, 25, 24, 19, 35, 26, 39, 21]) ___________________________________________
def random_count(random_list): for i in random_list: if i <= 33: print(np.sum(i))
This is what I've done, but I can only get it to list out the individual numbers, but i want it to total them up.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started