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
Write the following as a single integer
ANEK [815]

Answer:

YOUR ANSWER IS BELOW

Step-by-step explanation:

A IS 14

B IS -18

C IS -8

D IS -37

AND E IS 75

6 0
3 years ago
P^2 - 17p + 72 factor the trinomial. enter smaller number first ? answer (p+?)(p+?)
klio [65]

Answer:

(p - 8)(p - 9)

Step-by-step explanation:

We need  2 numbers whose product is + 72 and whose sum = -17.

They are -8 and -9


3 0
3 years ago
What is 19 divided by 3192
xxMikexx [17]
The answer is 168!!!!!!!!!!!!!!!!!!!
7 0
3 years ago
Read 2 more answers
Join for a maths intervention-foundation
In-s [12.5K]

Answer:

i \: wil \: join \: u \: for \\ maths \: intervention - fondation

5 0
3 years ago
Can anyone send working of this please ?
andrezito [222]
The parallel lines create similar triangles. Which means sides are proportional...
\frac{BR}{CS} = \frac{AR}{AS}
\frac{BR}{CS} = \frac{10}{14} = \frac{5}{7}
So if then the ratio of AR to AS = 5/7
Create a proportion with the other similar triangle that contains the shared side:
  \frac{5}{7} = \frac{e}{18}
Cross multiply
e = \frac{90}{7}=12 \frac{6}{7}
4 0
4 years ago
Other questions:
  • What is the absolute value of Point C labelled on the number line?
    7·1 answer
  • A researcher studying public opinion of proposed Social Security changes obtains a simple random sample of 35 adult Americans an
    11·1 answer
  • An ant travels at a constant rate of 30 cm every 2 minutes. At what speed does the ant travel per minute?
    14·1 answer
  • F(1) = 4<br> f(2) = 25<br> f(n) = f(n - 2). S (n - 1)<br> f(3) =
    7·1 answer
  • A rectangle has an area of 126.9m² . One of the sides is 2.7m in length. Work out the perimeter of the rectangle​
    11·1 answer
  • A regular price of a bathing suit is $89.99. What is the new price of the bathing suit when it is 70% off the regular price?
    11·2 answers
  • What is the slope of the line
    13·1 answer
  • At which value(s) of x does the graph of the function F(x) have a vertical asymptote? Check all that apply.
    15·2 answers
  • Help with this ill give brainlest
    12·2 answers
  • Find the x- and y-intercepts of the graph of — 7x + 8y = 40. State your answers as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!