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

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!