1answer.
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]
3 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]3 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]3 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
What percent of 180 is 30?
Ratling [72]

Answer:

16.67

Step-by-step explanation:

30: 180÷100 =

( 30÷00): 180 =

3000: 180 = 16.67

3 0
3 years ago
Which expression is equivalent to 5(w+4) when w=9
erica [24]

Answer: Should be 5(9)+4

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
Angles ∝ and β are the two acute angles in a right triangle. Use the relationship between sine and cosine to find the value of β
arlik [135]
Ok so cos(x) = sin(90-x) so using that you can get sin(7x-15) = sin(90-(3x+5)) so 7x-15 = -3x+85. 10x = 100 and x = 10. Use that to find the 2 angles are 55 and 35
5 0
3 years ago
Read 2 more answers
A scientist wants to find the radius, in feet, of this hemispherical dome. He found that the surface area of the entire sphere c
skelet666 [1.2K]
The surface area of a sphere by definition is given by:
 A = 4 * π * r ^ 2
 Where,
 r: radius of the sphere.
 Substituting the values we have:
 294 = 4 * π * r ^ 2
 We cleared the radio:
 r ^ 2 = (294) / (4 * π)
 Answer:
 An equation that I could use to find the dome's radius is:
 A. r2 = 294 square feet ÷ 4π
7 0
3 years ago
Excel computes a two‑sample confidence interval for the difference in proportions just as well and as easily as Minitab and othe
True [87]

Answer:

See ecplanation below

Step-by-step explanation:

False.

On the Data analysis tool from excel we can conduct the following procedures:

Anova: Single Factor

Anova: Two factor with replication

Anova: Two factor without replication

Correlation

Covariance

Descriptive statistics

Exponential smoothing

F-test Two sample for Variances

Fourier analysis

Histogram

Moving Average

Random number generation

Rank and percentile

Regression

Sampling

t test: Paired two sample for means

t tes: Two sample assuming equal variances

t test: Two sample Assuming Unequal Variances

z test: Two sample for means

And as we can see we don't have an specific procedure just to obtain confidence interval for the difference of proportions. We need to remember that if we select a z test in excel, for example the output will contain the confidence associated to the parameter, but for this case is not too easy obtain a confidence interval for the difference of proportion like on a statistical software as (Minitab, R, SAS, etc) since all of these statistical softwares are elaborated in order to conduct all the possible statistical tests and confidence intervals for parameters of interest.

5 0
3 years ago
Other questions:
  • "Judging by appearance, classify the figure in as many ways as possible.
    11·1 answer
  • Find the zeros of f(x) = (x -3)^2 - 49
    13·1 answer
  • Given the expression −10p2q + 7p3q − 5q
    5·1 answer
  • Out of 1200 students of a school only 85% passed. how many students failed?​
    10·1 answer
  • Help ASAP ! Please explain too
    9·2 answers
  • Pls help me with 3,4, and 5
    12·2 answers
  • Which equation does not represent a function?
    13·1 answer
  • An ice cream store has the following pints
    11·1 answer
  • Each interior angle of a regular polygon has a measure of 40.how many sides does the polygon have?​
    6·1 answer
  • Please help<br> pic provided below<br> what can you tell about the mean of each distribution?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!