def pr60(s):
s1 = ''
for t in s:
if t not in s1:
s1 += t
return s1 嘿嘿string = input('请输入字符串:')
def foobar(string):
string = list(string)
return ''.join(sorted(set(string),key=string.index))
print(foobar(string))
def str_set(string):
list_1 = []
str_1 = ''
if 0 < len(string) and len(string) <= 100 and string.isalpha():
for i in string:
if i not in list_1:
list_1.append(i)
for i in list_1:
str_1 += ''.join(i)
return str_1
else:
return '输入字符串最大长度100, 且包含字母,不包含空格'
print(str_set('abcqweracb')) 1 看看
页:
1
[2]