Python | sympy.prime() method
With the help of sympy.prime() method, we can find the nth prime, with the primes indexed as prime(1) = 2, prime(2) = 3, etc.
n – It denotes the nth prime number.
Returns: Returns the nth prime number.
The 5th prime is 11
The 23rd prime is 83
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course