输入一个字符串,把最左边的10个不重复的字符(大小写算不同字符)挑选出来。 如不重复的字符不到10个,则按实际数目输出。
输入格式:
输入一个字符串s。
输出格式:
输出一个字符串,包含字符串s最左边10个不重复的字符。不到10个按实际输出。
输入样例1:
在这里给出一组输入。例如:
Hello world, hello python
输出样例1:
在这里给出相应的输出。例如:
Helo wrd,h
输入样例2:
在这里给出一组输入。例如:
succeed
输出样例2:
在这里给出相应的输出。例如:
suced
def unique(s):
set1 = set([])
out = ""
for i in range(len(s)):
c = s[i]
if c not in set1:
out = out + c
set1.add(c)
return out[0:10]
def main():
strin = "Hello world, hello python"
ret = unique(strin)
print(ret)
if __name__ == '__main__':
main()