Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

Part 1:  Generate a list of Random Numbers

Write a program in Python that generates 20 random numbers and stores them in a list. The program should store the numbers in an array.  Use the list using the built-in functionality of the print functions.  Your output should look like this:

[22, 47, 71, 25, 28, 61, 79, 57, 89, 3, 29, 41, 99, 86, 75, 98, 4, 31, 22, 33]

Next, write a function that has the list as a parameter, and displays these statistics. Use the built-in min, max, sum, and len functions.

  • The lowest number
  • The highest number
  • The sum of the numbers

The output should look similar to  this:

Highest: 89
Lowest: 3
Sum: 482
Average: 48.2

Part 2: Prime Numbers List

For each number in your list, test to see if it is prime using the is_prime() function you wrote in the Prime Numbers lab.   If the number is prime, add it to a new list and delete it from the original list.   You'll end up with two lists: one with prime numbers and one with non-primes.   Put a test in your code to sum the length of the two lists to be sure there are still 20 numbers in total.    Now sort both lists with the built-in sort() function, then print them out.   Your output should be similar to this:

Primes:  [47, 71, 61, 79, 57, 89, 3, 29, 41, 31]

Non-primes:  [22, 25, 28, 99, 86, 75, 98, 4, 22, 33]

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92216283
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

How might social media help in recruiting passive job

How might social media help in recruiting passive job applicants, those not actively looking for a job?

Suppose the production function for a firm is given

Suppose the production function for a firm is given by:  q=4L 0.75 K 0.25 . If the firm currently has  10  units of capital (K) and  10  units of labor (L), then calculate the Marginal Rate of Technical Substitution (MRT ...

Discuss the principle components of an effective and

Discuss the principle components of an effective and compelling vision. Then present the vision for your current/previous organization, detailing how you would improve upon that vision to ensure that it conforms to your ...

Why do organizations so frequently overlook the on-boarding

Why do organizations so frequently overlook the on-boarding of new employees?

Many companies have codes of ethics to guide managers in

Many companies have codes of ethics to guide managers in their decision making. However, the evidence indicates that few people rely on a company code of ethics in their decision making. Are the codes valuable? Should co ...

Propose a mind map summarizing common business processes in

Propose a mind map summarizing common business processes in a manufacturing enterprise. Each leaf of the mind map has to correspond to one business process and briefly describe it. You may complete this sample: Main bus ...

What are the best practices a firm should follow to better

What are the best practices a firm should follow to better ensure compliance with US export controls?

Mr barney the ceo has received your memo request to be

Mr. Barney, the CEO, has received your memo request to be considered for further leadership positions. He has decided to put you to the test! He assigns you to help his Director of Payroll, Loretta Cash with a problem.  ...

1 please illustrate the process of sorting the sequence 3 1

1. Please illustrate the process of sorting the sequence 3, 1, 4, 5, 9, 2, 6, 5 using bubble sort. 2. Please illustrate the process of sorting the sequence 3, 1, 4, 1, 5, 9, 2, 6 using merge sort.. 3. Please determine th ...

What are some of the recent issues with ways to calculate

What are some of the recent issues with ways to calculate cost objective for direct material, direct labor, other direct costs, indirect costs, facilities cost of money, and profit/fees? How do we use these calculations ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As