file = input("Enter a filename: ")
fi = open(file, "r")
for line in fi:
line = line.split()
c = len(line)
print(line)
print (c)
def anydup(line): # Checks for duplicates in the rows
seen = set()
for x in line:
if x in seen:print("There are some duplicate numbers in the rows")
seen.add(x)
print("There are no duplicates in the rows")
有人可以告訴我如何檢查數字列中的重複項,我已經發現如何在行中找到重複項。這是一個數獨網格9x9。歡呼聲Python Column Duplicate Checker
請你給我一個例子 – user3396351