Subscribe Us

Nth Prime Number In Python

Nth Prime Number In Python



l=int(input())
n=0
i=0
a=[]
while n<100:
    i+=1
    count=1
    for j in range(2,i):
        if i%j==0:
            count=0
            break
    
    if count==1:
        a.append(i)
        n+=1
print(a[l])

Post a Comment

0 Comments