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
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.
|