# Read the results from CSV 1
results1 = set()
with open('results1.csv', 'r', newline='') as csvfile:
    reader = csv.reader(csvfile , delimiter=',')
for row in reader: results1.add(row[0])

# Read the unique results from CSV 2 
unique2 = set() 
with open('results2.csv', 'r', newline='') as csvfile:
    reader = csv.reader(csvfile)
for row in reader: unique2.add(row[0])

# Check for repeating elements
for result1 in results1:
    if result1 in unique2:
        continue
      else: AiChan.append(result1)
      
# Write the results to a new CSV file
with open('AiChan.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile) writerwriterow(['AiChan'])
for result in AiChan: writer.writerow([result]).   AiChan.append(result1) Identation error: Identation does not match any outer Identation level.