Returns the n-th prime number. >>> solution(6) 13 >>> solution(1) 2 >>> solution(3) 5 >>> solution(20) 71 >>> solution(50) 229 >>> solution(100) 541
(nth: int = 10001)
| 63 | |
| 64 | |
| 65 | def solution(nth: int = 10001) -> int: |
| 66 | """ |
| 67 | Returns the n-th prime number. |
| 68 | |
| 69 | >>> solution(6) |
| 70 | 13 |
| 71 | >>> solution(1) |
| 72 | 2 |
| 73 | >>> solution(3) |
| 74 | 5 |
| 75 | >>> solution(20) |
| 76 | 71 |
| 77 | >>> solution(50) |
| 78 | 229 |
| 79 | >>> solution(100) |
| 80 | 541 |
| 81 | """ |
| 82 | return next(itertools.islice(prime_generator(), nth - 1, nth)) |
| 83 | |
| 84 | |
| 85 | if __name__ == "__main__": |
no test coverage detected