PTA基础编程题目集 Python解法 7-29 删除字符串中的子串(str/in)
target = input()
sample = input()
while sample in target:
target = target.replace(sample,'')
#这里的操作和list是不一样的,list的reverse操作是把列表本身给改了,但是str是没有的。
print(target)
PTA基础编程题目集 Python解法 7-29 删除字符串中的子串(str/in)
target = input()
sample = input()
while sample in target:
target = target.replace(sample,'')
#这里的操作和list是不一样的,list的reverse操作是把列表本身给改了,但是str是没有的。
print(target)