I've got this, and it works. It just takes a large amount of time for numbers 100000+ I'm looking to cut it down so that it can calculate the 1,000,000th prime in less than 3 minutes. I've set it so that our number (chk) is only having numbers (odds) being divided into it, to check for divisibility, up to the square root of chk. The program is set to find the nth prime number up to the 1000000th. Thanks.
goal=int(input("Enter a number n, 1-1,000,000 to find the nth prime number.")) #how many primes we need to find
if goal>1000000: #closes the program if the number doesn't fit the parameters
exit()
if goal==1: #takes care of the first prime, which is 2
print("2")
if goal==2: #and then the second, which is 3
print("3")
chk=5 #the next odd number after 3, which is already taken care of above
primes=2 #the number of primes recorded, after counting 2 and 3.
x=0 #the last recorded prime number
while primes<goal:
if chk<9: #if the number is odd and below 9....
primes+=1 #it's prime
x=chk #record that number
chk+=2 #and check the next odd number
else: #if it's =>9......
odds=3 #check to see if it's divisible by the smallest odd number
sqrtk=chk**.5 #all the way up to the square root of chk
while odds<sqrtk or odds==sqrtk: #if at any time...
if chk%odds==0: #...chk is divisible by this odd number....
chk+=2 #then raise the value of chk to the next odd number
break #and start the check from the beginning with next k
else: #if not...
odds+=2 #check to see if it's divisible by the next odd number.
if odds>sqrtk: #if chk isn't divisible by any odds up to the square root of chk
primes+=1 #we have a prime number
x=chk #record that number
chk+=2 #check the next odd number to see if it's prime
odds=3 #and reset odds back to 3 to use it next time
if primes==goal: #once we've reached the desired amount of prime numbers
print("The",goal,"prime number is:",x) #print that prime number