Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check nth prime in python

x=int(input())
n,c=1,0
while(c<x):
    n+=1
    for i in range(2,n+1):
        if(n%i==0):
            break
    if(i==n):
        c=c+1
print(n)
 
PREVIOUS NEXT
Tagged: #check #nth #prime #python
ADD COMMENT
Topic
Name
8+8 =