Counting primes

Write code · Medium · §2.1 Primes

Complete the function solution, which returns how many primes there are among the positive integers from 1 to limit. limit itself is included.

Function

solution(limit)

Constraints

Examples

limitresult
104
208

Starter code

def solution(limit):
    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.