words = input("请输入一段字符串:") word = input("请输入一个字符:") # print(dir(words)) if word in words: # nt[word] = count.get(word, 0) + 1 # items = list(count.items()) if words.count(word)>1: print(True)
输出结果