The k-th prime

Write code · Challenge · §2.1 Primes

Complete the function solution, which returns the k-th smallest prime. The first prime is 2.

Function

solution(k)

Constraints

Examples

kresult
12
511

Starter code

def solution(k):
    answer = 0
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.