Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago