MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_prime

Function is_prime

project_euler/problem_035/sol1.py:30–40  ·  view source on GitHub ↗

For 2 <= n <= 1000000, return True if n is prime. >>> is_prime(87) False >>> is_prime(23) True >>> is_prime(25363) False

(n: int)

Source from the content-addressed store, hash-verified

28
29
30def is_prime(n: int) -> bool:
31 """
32 For 2 <= n <= 1000000, return True if n is prime.
33 >>> is_prime(87)
34 False
35 >>> is_prime(23)
36 True
37 >>> is_prime(25363)
38 False
39 """
40 return sieve[n]
41
42
43def contains_an_even_digit(n: int) -> bool:

Callers 1

find_circular_primesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected