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
I need help finding area of this shape
quester [9]

Answer:

170

Step-by-step explanation:

30 x 3 then do 10 x 8

90 + 80

5 0
3 years ago
I’m not sure I understand this equation
AURORKA [14]

Answer:

ASSUMING there are 4 answer

It'll be the third option ( or bottom left depending how you look at it )

Step-by-step explanation:

The negative in the equation will have shade colour in the negative side ( Left side of the slope ).

7 0
3 years ago
What is the answer to 3.4m+2.4m​
polet [3.4K]

Answer:

5.8m

Step-by-step explanation:

8 0
3 years ago
Geometry exam help !!!!please
natta225 [31]

Answer:

you add 17+6 and it would be x=23

Step-by-step explanation:

4 0
3 years ago
Find a solution of the linear inequality <br> y ≥ 4x - 5
ivolga24 [154]

Step-by-step explanation:

-5>4 because it is based on formula

5 0
2 years ago
Other questions:
  • A student has gotten the following grades on his tests. What is the minimum grade he must get on the last test in order to have
    13·1 answer
  • In a math game rob reads four statements about the number 51. He has to pick up the true statement to win the game. Which statem
    9·1 answer
  • Easy Question:598-__=78
    7·2 answers
  • Maureen earns $12 an hour babysitting. She spent $65 on a phone for her
    10·2 answers
  • What are the solutions to the system of equations graphed below?
    11·1 answer
  • What are some Integers that are not whole numbers? Please help its due tomorrow!! and its currently 8pm. I need this! I'll give
    6·1 answer
  • Please answer and explain I’ll mark brainliest!!!!!
    7·1 answer
  • Fourteen hours after a convict escapes from prison, a guard begins to pursue him. If the convict travels at eight mph on foot an
    5·1 answer
  • Find the slope of the line that passes through (9, 10) and (1, 13) .
    5·1 answer
  • What is 9 + 10 <br><br><br><br><br><br><br><br> FROM THE MEME ONLY
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!