Generate a list of random numbers

Assignment Help Business Management
Reference no: EM131406484

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]

Reference no: EM131406484

Questions Cloud

Research paper on computer programming : Research Paper on computer programming, different coding languages and their impact on the Technology field.
Options for improving the security : A firm is considering two options for improving the security of its employee accounts from remote compromise. The firm calculates that the probability of compromise without enacting any additional security measures is 0.5, and that successful atta..
Why does it provide a relatively poor hedge : Explain how a stop-loss hedging scheme can be implemented for the miter of an out-of-the-money call option. Why does it provide a relatively poor hedge?
Discuss the overview of network security fundamentals : They provide you with the following report outline to use: Introduction and Overview of network security fundamentals, security threats, and issues (discuss from a companywide standpoint)
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:
What is the 5-day 99% value at risk for the portfolio : Consider a position consisting of a 8100,000 investment in asset A and a 5100.000 investment in asset B. Assume that the daily volatilities of both assets arc I% and that the coefficient of correlation between their returns is 0.3. What is the 5-d..
Information and prints a payroll statement : Write a program with Python that reads the following information and prints a payroll statement:
What is the 5-day 95% value at risk for the portfolio : Assume that the daily volatilities of the assets are 1.8% and 1.2%, respectively, and that the coefficient of correlation between their returns is 0.3. What is the 5-day 95% value at risk for the portfolio?
What kinds of sources do you plan to use for research : What kinds of sources (for example, company website, annual report, government websites, and library articles) do you plan to use for research?

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd