-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhcf.py
More file actions
36 lines (25 loc) · 634 Bytes
/
Copy pathhcf.py
File metadata and controls
36 lines (25 loc) · 634 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
listed = []
listed2 = []
def factorialnum_list(x):
for i in range(1, x + 1):
if x % i == 0:
listed.append(i)
# print(listed)
# print(i)
return listed
def factorialnum_list2(y):
for i in range(1, y + 1):
if y % i == 0:
listed2.append(i)
# print(listed)
# print(i)
return listed2
def hcf(a, b):
factorialnum_list(a)
factorialnum_list2(b)
return (max(list(set(listed).intersection(listed2))))
# print(alist)
# print(blist)
# print(factorialnum(27)
print(hcf(26, 20))
# print(max(factorialnum_list(b)))