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
A frozen dinner at the grocery store is purchased for $2.20 a wholesale and is a marked up for 40 percent. a customer wants to b
iren [92.7K]

First of all, you surely do have a lot of incorrect grammar in your statement. I can't understand a word that you are asking.

3 0
3 years ago
This morning I went to Larry's for breakfast.
Olin [163]

Answer:

9 dollars and 18 cents

Step-by-step explanation:

6 0
3 years ago
What is the unit rate of 115miles in 2hours
maksim [4K]
You would divide miles to hours amd get 57.5
5 0
4 years ago
Read 2 more answers
#17. The height, H metres, of a certain species of Fir
olya-2409 [2.1K]

Answer:

The approximated height of the tree is of 112 meters.

Step-by-step explanation:

The height of a tree with a base diameter of d meters is approximated by the following formula:

h = 35d

In this question:

Base diameter of 3.2m, so d = 3.2, and the height is in meters.

h = 35d = 35(3.2) = 112

The approximated height of the tree is of 112 meters.

7 0
3 years ago
Three interior angles of a polygon are,100degrees,120degrees,and 108degrees.Find the remaining two sides,if one of them is three
k0ka [10]

Answer:

Joe Mama :))))))))))))))))))))))

Step-by-step explanation:

8 0
3 years ago
Other questions:
  • Legend has it that the great mathematician Carl Friedrich Gauss ​(1777dash–​1855) at a very young age was told by his teacher to
    10·1 answer
  • Graph the circle (x+6)^2 + (y+5)^2 =9
    15·1 answer
  • What is greatest to least 1.001,1.1,1.403,1.078
    6·2 answers
  • A) Calculate an estimate for the mean height of the students. 129.3 cm
    5·1 answer
  • 1. Five more than twice a number is 7.
    7·2 answers
  • Pls help me. Show proof on why it’s that answer.
    6·1 answer
  • Communicate Due to global climate changes, more hurricanes are expected to hit the Gulf Coast. What might happen to gas and oil
    11·1 answer
  • I NEED HELP WITH THIS PICTURE IS PROVIDED
    15·1 answer
  • Find all values of x in the interval [0, 2π] that satisfy the equation. (Enter your answers as a comma-separated list.)
    15·1 answer
  • Help please ill give extra to brainliest<br> 13d +8= -1<br><br> d=?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!