# M1.py def func1(CC): CC1 = [] CC2 = [] i = 0 while i < len(CC): value = CC[i] j = 0 exists = 0 while j < len(CC1): if CC1[j] == value: exists = 1 break j = j + 1 if exists == 0: CC1.append(value) i = i + 1 i = 0 while i < len(CC1): value = CC1[i] count = 0 j = 0 while j < len(CC): if CC[j] == value: count = count + 1 j = j + 1 CC2.append(count) i = i + 1 return CC1, CC2 def func2(filename, CC, n): with open(filename, "w", encoding="utf-8") as f: i = 0 in_line = 0 while i < len(CC): if in_line > 0: f.write(" ") f.write(str(CC[i])) in_line = in_line + 1 if in_line == n: f.write("\n") in_line = 0 i = i + 1 if in_line != 0: f.write("\n")