words = input("请输入一段字符串:") def cf(words): if len(set(words))<len(words): print("有重复值") else: print("无重复值") cf(words) 运行结果为