本题因为要求要按发现顺序输出,所以不能使用集合。
a = input()
b = input()
#全部转换为大写
a = a.upper()
b = b.upper()
result=[]
#判定a中字符b中是否存在
for x in a:
if x not in b and x not in result:
result.append(x)
for i in result:
print(i,end='')
本题因为要求要按发现顺序输出,所以不能使用集合。
a = input()
b = input()
#全部转换为大写
a = a.upper()
b = b.upper()
result=[]
#判定a中字符b中是否存在
for x in a:
if x not in b and x not in result:
result.append(x)
for i in result:
print(i,end='')

被折叠的 条评论
为什么被折叠?
