首页 > TAG信息列表 > 字条

判断字符串是否有重复字条

strs = 'Goaod' hashTable = dict() listStrs = list(strs) i = 0 while i < len(strs): if listStrs[i] in hashTable: print("有重复字符") break else: hashTable[listStrs[i]] = None i += 1