题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
a=input() b='' for i in range(1,len(a)+1): if a[-i] not in b: b=b+a[-i] if b[0] == '0': print(b.replace('0','')) else: print(b)
活用not in
知识点:字符串的replace方法
注意b[0]=‘0’这里的引号不能漏代表字符串类型