收起
不重复的字符为 这个打印放到for循环外即可
s=input("请输入一个字符串:") d={} print("不重复的字符为:",end="") for i in range(len(s)): if s[i] not in d: print("{}".format(s[i]),end="") d[s[i]]=1
报告相同问题?