Question: please do this in python 3.8 without numpy this is the program used in question 3 please use it to answer question 4 (im using
please do this in python 3.8 without numpy
this is the program used in question 3 please use it to answer question 4 (im using the answer from cheggs answer to come up with my own solution to modifying my own program):
print("Is The Integer Prime ?") n = int(input("Enter an integer: "))
is_prime = n > 1 for i in range(2, n): if n % i == 0: is_prime = False
if is_prime: print(n, "is Prime") else: print(n, "is not a Prime")

Question 4 (20 Points) How Many Prime Numbers within a range of 1 to M2 (Embedded For Loops: Inner/Outer) In a well-commented Python program hmwk204.py, extend the solution provided in Question 3 to determine if the number of prime numbers between 1 and M. Include a screen capture Himwk204.jpg for the test case below. Hints: Number of Primes Between 2 and M Enter an integer: 1000 168 Hmwk204.jpg 1. Question 3 provides a test if a single integer Nis prime or not. 2. Remove the input function to query the user for the integer N. 3. Embed (i.e. intent) the code for the single integer test in an outer for loop that uses N as the index variable 4. The outer for loop has the limits for Nin range(1, M+1)!, where M is the value supplied by the user 5. Mis defined before the outer loop is executed 6. A counter of the number primes is initialized to zero before the outer loop is executed. 7. The counter is incremented INSIDE the OUTER loop when the INNER LOOP determines that N is prime Grading: 2 points for comments, 2 points for obtaining M, the upper limit of the prime number test from a user, 8 points for the correct OUTER LOOP, 2 points for initiating the counter, 2 points for incrementing the count, 2 points for implementing the correct INNER LOOP (extending Hmw203.py) and 2 points for Hmwk204.jpg
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
