-
Notifications
You must be signed in to change notification settings - Fork 0
/
prime_number.old.exem
49 lines (39 loc) · 950 Bytes
/
prime_number.old.exem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
"A prime number (or a prime) is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers."
Considering the case of # 2, it fits the definition of prime because it is >1 and cannot be formed by multiplying two smaller natural #s.
todo Det what to do about the (i1-1)>2 conditions because can't rely on user to give them.
@title Describe the target function for its docstring this way or:
:param line: String to denude of possible line comment.
:return:
"""
2
True
i1 == 2
3
True
i1 % (i1-1) != 0, (i1-1)==2
4
False
i1 % (i1-1) != 0, (i1-1)>2,
i1 % (i1-2) == 0
5
True
i1 % (i1-1) != 0, (i1-1)>2,
i1 % (i1-2) != 0, (i1-2)>2,
i1 % (i1-3) != 0, (i1-3)==2
6
False
i1 % (i1-1) != 0, (i1-1)>2,
i1 % (i1-2) != 0, (i1-2)>2,
i1 % (i1-3) != 0, (i1-3)>2,
i1 % (i1-4) == 0 # todo Get "not (i1 % (i1-4) != 0)" working here as well.
0
"input < 1 is illegal"
i1 < 1
1
False
i1 == 1
1008
False
1009
True