We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ddd81d commit 07141e4Copy full SHA for 07141e4
maths/prime_check.py
@@ -5,9 +5,28 @@
5
6
7
def prime_check(number: int) -> bool:
8
- """Checks to see if a number is a prime.
+ """Checks to see if a number is a prime in O(sqrt(n)).
9
10
A number is prime if it has exactly two factors: 1 and itself.
11
+
12
+ >>> prime_check(0)
13
+ False
14
+ >>> prime_check(1)
15
16
+ >>> prime_check(2)
17
+ True
18
+ >>> prime_check(3)
19
20
+ >>> prime_check(27)
21
22
+ >>> prime_check(87)
23
24
+ >>> prime_check(563)
25
26
+ >>> prime_check(2999)
27
28
+ >>> prime_check(67483)
29
30
"""
31
32
if 1 < number < 4:
0 commit comments