Question: finding tge mth prime number print(Is The Integer Prime ?) # ask the user to input an integer N N = int(input(Enter an integer: ))

print("Is The Integer Prime ?") \# ask the user to input an integer N N = int(input("Enter an integer: ")) \# initialize an empty list to store the factors factors =[] \# loop through the integers from 1 to N1 for i in range (2,N) : \# check if i is a factor of N if N%i=0: \# if i is a factor, append it to the list of factors factors.append(i) \# check if the length of the list of factors is 0 if len (factors) =0 : # if the length of the list of factors is 0,N is a prime number print (f"{N} is Prime") else: # if the length of the list of factors is not 0,N is not a prime number print(f"{f} is not Prime") Finding the Mti Prime Number Write a well-documented Python program, hmwk3Q1.py that finds the Mth prime number by extending hmwk2Q3.py; which finds the prime number for a single number. Have your program query the user for the integer M. Print the value of the 908th prime number and record it as a comment in your Python program. Hints: Re-use hmwk2Q3.py software by embedding it in a while-loop. The while-loop continues to call upon the prime number code until it finds the 908t prime number. Make sure that inside the while-toop you implement a counter, which is incremented when a prime number is found
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
