Create two empty lists

Assignment Help Business Economics
Reference no: EM132160463

Need to create two empty lists: that is prime and non_prime. For the each random number, test to see if it is prime using a boolean is_prime(x) function.  If the number is prime, append it to the prime list; if the number is non_prime, append it to the non_prime list.  So, print the two lists thats output should looks like similar to this:

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

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

Make a python file (.py)

Additional Instructions

According to above the lab document its can be "write the own is_prime(x) function", or use this one:

def is_prime(x):

  if x >= 2:

    for y in range(2,x):

      if not ( x % y ):

        return False

  else:

    return False

  return True

Reference no: EM132160463

Questions Cloud

Compute the uniform annual expenditure : An engineer has a fluctuating future budget for the maintenance of a particular machine. During each of the first 5 years, $1000 per year will be budgeted.
Why are popular prophets so keen on setting dates : IDST 390: When studying the history of The End, one of the most stark (and cautionary) tales of predicting the end of the world is found in the story .
What is the equivalent uniform annual cost of owning : A machine has a first cost of $150,000, an annual operation and maintenance cost of $2500, a life of 10 years, and a salvage value of $30,000.
Disadvantages of scheme : Other than slowness or inefficiency, what are two other disadvantages of this scheme?
Create two empty lists : Need to create two empty lists: that is prime and non_prime. For the each random number, test to see if it is prime using a boolean is_prime(x) function
What are three threats to information security : What is a mitigation measure and a response/recover action for each threat you identified.
Make a java program for backword string : To make method that should accepts a String object as an argument and the displays contents back-word. For instance, if the string argument
Is it economical to install and operate the baler : The Johnson Company pays $2000 a month to a trucker to haul wastepaper and cardboard to the city dump. The material could be recycled if the company.
Spatial data creation and spatial data editing : What are four different applications where digitizing (spatial data creation and/or spatial data editing) would be useful.

Reviews

Write a Review

Business Economics Questions & Answers

  Explain each in the context of specific product and service

Throughly explain each of Friedman's 4 ways to spend money. Explain each in the context of a specific product or service. What can we expect in terms of both price and quality for products purchased under each of the four circumstances. Which is the ..

  Increasing transformation-utility function

Problem associated with first video: Increasing transformation Consider the following utility function u(x1, x2) = x1x2. Calculate the MRS for this utility function. Compute and compare the MRS for the bundles (x1, x2) = (1, 2) and (x1, x2) = (2, 1)...

  Monopolistic firms and the trans pacific partnership

What do the monopolistic firms and the Trans Pacific Partnership (tpp) have in common and how the monopolistic firm will be effective. Will the profit increase or decrease.

  Calculate the arc price elasticity of demand

In order to attract more customers on Mondays ( a slow day), Alex's pizza shop decided to reduce the price of their pizza rolls from $3.50 to $2.50. As a result, Monday sales increased from 70 to 130. Also, Alex's sales of soft drinks rose from 40 to..

  What price would your bond sell in the secondary market

The market interest rate increases to 10%. IN the afternoon at what price would your bond sell in the secondary market.

  Find the altitude of the satellite

An artificial satellite circling the Earth completes each orbit in 112 minutes.

  Increase lead to largest income effect for most consumer

For which of the following goods would a 10 percent price increase lead to the largest income effect for most consumers?

  Test practice questions

1) You are an investment analyst. The retail market that you have been investing in, tobacco, has been hit by an increase in sales taxes that are levied on tobacco sellers. Assume that the price elasticity of demand for tobacco is close to zero, w..

  Terms of historical volatility of realized returns

Rank stocks, bonds and (Treasury) bills from least risky to most risky, in terms of historical volatility of realized returns. a. stocks, bonds, bills b. bonds, stocks, bills c. bills, stocks, bonds d. bills, bonds, stocks e. stocks, bills, bonds

  Bridge authorities increase their revenues by changing

Suppose the demand for crossing the Golden Gate Bridge is given by. What is the price elasticity of demand at this point? Could the bridge authorities increase their revenues by changing their price?

  Any other strategy in the reduced form game

There are three ice cream vendors who are deciding where to locate on a beach. The only decision that they have to make is where to locate the store that they have to run. There are 10 positions available on the beach and costumers are uniformly dist..

  What is your ethical obligation

Many television shows, movies, and songs can be downloaded for free on the Internet. Much of this material is copyrighted and was expensive to produce. Much of it is available for a fee through a legitimate site. Should you pay to download an episode..

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