-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex3.py
More file actions
43 lines (40 loc) · 878 Bytes
/
ex3.py
File metadata and controls
43 lines (40 loc) · 878 Bytes
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
def checkPrimeNumber(n):
a = int
if n == 2:
a = 1
for i in range(2,n):
if n % i == 0:
a = 0
break
else:
a = 1
return a
def swap(n):
l = list(str(n))
a = l[0]
del l[0]
l.append(a)
kq = 0
for i in range(len(l)):
kq = kq + int(l[i])* (10**(len(l) - i - 1))
return kq
def kiemtra(n):
l = list(str(n))
for i in range(len(l)):
if checkPrimeNumber(n) == 0:
print('Not curcle prime number')
break
else:
print(n)
n = swap(n)
# so = n
# if checkPrimeNumber(n) == 1:
# print(n)
# n = swap(n)
# if n != so:
# kiemtra(n)
# else:
# return 0
# else:
# print('khong phai')
kiemtra(3119)