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

  Economics assignment

This document contains various important questions and their appropriate answers in the subject field of Economics.

  Demand and supply curves

Economics is the study of the principles governing the allocation of scarce means among competing ends when the objective of the allocation is to maximize the attainment of the ends.

  Long-run perfectly competitive equilibrium for the firm

Evaluate Government intervene and correct this situation?(a) Explain the concept of a concentration ratio. A rise in the price of magarine Explain the impact of external costs and external benefits on resource allocation long-run perfectly c..

  Supply and demand diagrams

Explain each of the following using supply and demand diagrams,  With the use of a graph, explain how these two programs affect cigarette consumption and the price of cigarettes.

  Case study: fisher-price toys

The case study of the Fisher-Price Toys, Inc., a popular case in basic economics and management from the prestigious Harvard Business School.

  Draw the production possibility curve

Draw the production possibility curve and a. Define consumer surplus and producer surplus.

  Tax revenue

The Australian government administers two programs that affect the market for cigarettes

  Maximize total welfare

How many tickets to sell to maximize total welfare.

  Difference between the cv and the ev

The change in consumer surplus (?CS) is not "theoretically" justifiable like the CV and EV but it continues to be the most widely used measure of consumer welfare change. Explain how this can be reconciled

  Depict von neumann-morgenstern utility index u in a diagram

Depict the von Neumann-Morgenstern utility index u in a diagram

  What is the market solution

What is the market solution (market price and quantity) and What is the total surplus of the society under the market solution

  Calculate gross national product and net national product

Calculate gross national product and net national product

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