answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
atroni [7]
2 years ago
9

Given a positive integer n, assign true to is_prime if n has no factors other than 1 and itself. (remember, m is a factor of n i

f m divides n evenly.)
Mathematics
2 answers:
yawa3891 [41]2 years ago
6 0
This is the following condition in order to get the specific output for this specific problem: if is_a_prime(n):<span>    is_prime = True</span> <span><span>Now all you have to do is write is_a_prime().

For the hard code for this problem:

</span>if n == 2:<span>
is_prime = True
elif n % 2 == 0:
is_prime = False
else:
is_prime = True 
for m in range (3, int (n * 0.5) + 1, 2): 
if n % m == 0: 
is_prime = False 
<span>break.</span></span></span> 
<span>
To add, a high-level programming language that is widely used for general-purpose programming<span>, created by Guido van Rossum and first released in 1991 is called Python.</span></span>
vlada-n [284]2 years ago
3 0

Below is the solution of assign true to is_prime if n has no factors other than 1 and itself.

<h3>Further explanation </h3>

Python is an interpreted, high-level, general-purpose programming language. Python is created by Guido van Rossum and first released in 1991. Its design philosophy emphasizes code readability. Python is a more productive language than Java because it is an interpretive language which is accompanied by elegant syntax and it makes an excellent choice for scripting and rapid application development in many areas. Python is a general-purpose, versatile and popular because it is concise and easy to read, and it is also a good language to have in any programmer’s stack as it can be used for everything such as web development, software development, data science applications.

Given a positive integer n, assign true to is_prime if n has no factors other than 1 and itself. And remember, m is a factor of n if m divides n evenly. So:

<em> if n == 2: </em>

<em>is_prime = True </em>

<em>elif n % 2 == 0: </em>

<em>is_prime = False </em>

<em>else: </em>

<em>is_prime = True </em>

<em>for m in range (3, int(n**0.5)+1, 2): </em>

<em>if n % m == 0: </em>

<em>is_prime = False</em>

<h3>Learn more</h3>
  1. Learn more about python brainly.com/question/4331067
  2. Learn more about python IDLE or similar environment  brainly.com/question/6280029
  3. Learn more about python function brainly.com/question/9806744

<h3>Answer details</h3>

Grade:  9

Subject:  mathematics

Chapter:  python

Keywords:  python, integer, factors, python IDLE, <em>is_prime</em>

You might be interested in
Work out the probability that halima at least walks one way
ANEK [815]
Can you please explain what you said
8 0
2 years ago
What are the x-intercepts of the function f(x) = –2x2 – 3x + 20?
Hatshy [7]

The root sof this quadratic equation are -4 and 2.5.


The roots of any quadratic can be found by using the quadratic equation. The equation is below for you.


\frac{-b +/- \sqrt{b^{2}- 4ac}}{2a}


In this equation you use the number attached to x^2 as the a, which in this case is -2. The number attached to x as b, which is in this case -3. And the number at the end as c, which is 20. From there you solve for the answers.


\frac{3 +/- \sqrt{-3^{2}- 4(-2)(20)}}{2(-2)}

\frac{3 +/- \sqrt{9 + 160}}{-4}

\frac{3 +/- 13}}{4}


Now you separate and get the two separate answers. First the positive.


\frac{3 + 13}}{4}

\frac{16}}{4}

4


Now the negative


\frac{3 - 13}}{4}

\frac{-10}}{4}

-2.5

5 0
2 years ago
Read 2 more answers
An online news source reports that the proportion of smartphone owners who use a certain operating system is 0.216. Two simulati
kaheart [24]

Answer:

The center/ mean will almost be equal, and the variability of simulation B will be higher than the variability of simulation A.

Step-by-step explanation:

Solution

Normally, a distribution sample is mostly affected by sample size.

As a rule, sampling error decreases by half by increasing the  sample size four times.

In this case, B sample is 2 times higher the A sample size.

Now, the Mean sampling error is affected and is not higher for A.

But it's sample is huge for this, Thus, they are almost equal

Variability of simulation decreases with increase in number of trials. A has less variability.

With increase number of trials, variability of simulation decreases, so A has less variability.

4 0
2 years ago
Each function below describes how something changes. Use the description to determine which function(s) describe exponential gro
cestrela7 [59]

Answer: E. The population decreased by 11% each year.

Step-by-step explanation: In A, the pollution increases at a constant rate, but in a linear way, in other words in each day, the pollution increases 10 grams; The same goes for C: ice "grows" a few milimeters each day; In D, as volume is calculated by the multiplication of π and its radius, the increase in the volume is still linear. In B, the proportionality is related to the power of the turbine not the growth or decay of it. In E, a population grows or decreases in a form of A=A₀(1±r)^t. In this case: A = A₀ (1-0.11)^t.

In conclusion, the function that better describes an exponential growth or decay is the decrease of a population.

6 0
2 years ago
Merle Fonda opened a new savings account. She deposited $40,000 at 10% compounded semiannually. At the start of the fourth year,
IrinaVladis [17]
Use compound interest formula  F=P(1+i)^n twice, one for each deposit and sum the two results.

For the P=$40,000 deposit,
i=10%/2=5%  (semi-annual)
number of periods (6 months), n = 6*2 = 12
Future value (at end of year 6),
F = P(1+i)^n = 40,000(1+0.05)^12 = $71834.253

For the P=20000, deposited at the START of the fourth year, which is the same as the end of the third year.
i=5% (semi-annual
n=2*(6-3), n = 6 
Future value (at end of year 6)
F=P(1+i)^n = 20000(1+0.05)^6 = 26801.913

Total amount after 6 years
= 71834.253 + 26801.913
=98636.17   (to the nearest cent.)
8 0
2 years ago
Other questions:
  • A scientist had a bottle that contains 56.6 ML of a solution. she used 3.2 ML of the solution for an experiment then she poured
    11·1 answer
  • Fleece vests regularly priced at $18.88 are on sale for $15.99. If the sales tax is 5%, how much can you save by buying the vest
    14·2 answers
  • Michelle exercises for half an hour every day. How minutes in total does she exercise for over 5 days?
    15·2 answers
  • An equation is written to represent the relationship between the temperature in Alaska during a snow storm, y, as it relates to
    11·1 answer
  • Researchers studying the effectiveness of a diet on heart disease divided the study's participants into two groups—those with Ty
    8·1 answer
  • Consider the system of components connected as in the accompanying picture. Components 1 and 2 are connected in parallel, so tha
    15·2 answers
  • A group of 6 men and 6 women is randomly divided into 2 groups of size 6 each. What is the probability that both groups will hav
    12·2 answers
  • After their hike, Joe and Mike took a taxi back to the trailhead. The taxi cost $26 plus $0.35 per mile. Which type of function
    9·1 answer
  • Which geometric solids would model the tent?
    10·2 answers
  • 15. Snazzy Sneakers has a shoe sale. Anthony buys 4 pairs of shoes. How can you represent this? Choose all that apply.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!