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
If the original square had a side length of
irina [24]

Answer:

Part a) The new rectangle labeled in the attached figure N 2

Part b) The diagram of the new rectangle with their areas  in the attached figure N 3, and the trinomial is x^{2} +11x+28

Part c) The area of the second rectangle is 54 in^2

Part d) see the explanation

Step-by-step explanation:

The complete question in the attached figure N 1

Part a) If the original square is shown below with side lengths marked with x, label the second diagram to represent the new rectangle constructed by increasing the sides as described above

we know that

The dimensions of the new rectangle will be

Length=(x+4)\ in

width=(x+7)\ in

The diagram of the new rectangle in the attached figure N 2

Part b) Label each portion of the second diagram with their areas in terms of x (when applicable) State the product of (x+4) and (x+7) as a trinomial

The diagram of the new rectangle with their areas  in the attached figure N 3

we have that

To find out the area of each portion, multiply its length by its width

A1=(x)(x)=x^{2}\ in^2

A2=(4)(x)=4x\ in^2

A3=(x)(7)=7x\ in^2

A4=(4)(7)=28\ in^2

The total area of the second rectangle is the sum of the four areas

A=A1+A2+A3+A4

State the product of (x+4) and (x+7) as a trinomial

(x+4)(x+7)=x^{2}+7x+4x+28=x^{2} +11x+28

Part c) If the original square had a side length of  x = 2 inches, then what is the area of the  second rectangle?

we know that

The area of the second rectangle is equal to

A=A1+A2+A3+A4

For x=2 in

substitute the value of x in the area of each portion

A1=(2)(2)=4\ in^2

A2=(4)(2)=8\ in^2

A3=(2)(7)=14\ in^2

A4=(4)(7)=28\ in^2

A=4+8+14+28

A=54\ in^2

Part d) Verify that the trinomial you found in Part b) has the same value as Part c) for x=2 in

We have that

The trinomial is

A(x)=x^{2} +11x+28

For x=2 in

substitute and solve for A(x)

A(2)=2^{2} +11(2)+28

A(2)=4 +22+28

A(2)=54\ in^2 ----> verified

therefore

The trinomial represent the total area of the second rectangle

7 0
3 years ago
24. q + r t s, for q = 46, r = 19. s = 54​
Kaylis [27]

(24 \times 46 )+ (19 \times t \times 54) =

1104 + 1026t

_________________________________

And we're done.

Thanks for watching buddy good luck.

♥️♥️♥️♥️♥️

8 0
3 years ago
Please help thank you!! will give brainlist!​
ratelena [41]

Answer:

the third one

Step-by-step explanation:

y+8= 4(x-3)

y+8= 4x-12

y= 4x-20

5 0
3 years ago
Pls help its due today
Simora [160]

Answer:

the answer is a, unchecked growth

5 0
3 years ago
Read 2 more answers
What does 2 1/4 - 1 2/3?
Degger [83]

Answer:


eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

7 0
3 years ago
Read 2 more answers
Other questions:
  • Draw the image of &lt;EFG after the transformation. identify the type of transformation
    12·1 answer
  • Members of a baseball team raised $967.50 to go to a tournament. they rented a bus for $450.00 and budgeted $28.75 per player fo
    6·2 answers
  • 20. Rectangle ABCD is transformed to create rectangle EFGH. What sequence of
    13·1 answer
  • Solving systems of equations by substitution<br> y= x - 8<br> y = -4
    13·1 answer
  • Karen’s batting average was 0.444 she was at bat 45 times. How many hits did she get ?
    6·1 answer
  • Please help
    15·1 answer
  • Urgent help please!
    5·1 answer
  • Help please thanks :))))))))))))))))
    15·2 answers
  • An element with a mass of 990 grams decays by 16.9% per minute. To the nearest Minute, how lon will it be until there are 80 gra
    13·1 answer
  • Help me please I beg
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!