-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (29 loc) · 1.39 KB
/
main.py
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
from crypto_functions import prime_number_check
from crypto_functions import prime_range
print("If you want just to check if a number is a prime number, type: 1")
print("If you want to know all prime numbers within a given range starting with 1 to any other integer and positive "
"number, type: 2")
option_type = int(input())
while option_type != 1 or option_type != 2:
print("If you want just to check if a number is a prime number, type: 1")
print("If you want to know all prime numbers within a given range starting with 1 to any other integer and "
"positive number, type: 2")
option_type = int(input())
if option_type == 1:
print("Number to check (must be integer and positive) if it is a prime number or not: ")
x = int(input())
result = prime_number_check(x)
if not result:
print("The given number", x, "IS NOT a prime number")
else:
print("The given number", x, "IS a prime number")
else:
print("Enter 2 integer numbers. The first number can not be zero and the second number must be greater than the first")
a = int(input())
b = int(input())
while a >= b or a == 0:
print("Enter 2 integer numbers. The first number can not be zero and the second number must be greater than the first")
a = int(input())
b = int(input())
result = prime_range(a, b)
print("Numbers discovered:", result)