def diff_list(lst , k):
newlst = [i +k for i in lst]
return len(set(lst) & set(newlst))
再把输入定义一下,AC