题目描述:

输入两个字符串,从第一字符串中删除第二个字符串中所有的字符。例
如,输入”They are students.”和”aeiou”,
则删除之后的第一个字符串变成”Thy r stdnts.”
- 输入描述:
每个测试输入包含2个字符串
- 输出描述:
输出删除后的字符串
- 示例1:
输入
    They are students.
    aeiou
输出
    Thy r stdnts.

代码如下:

"""
# _*_coding:utf-8_*_
Name:str.py
Date:1/15/19
Author:westos-sql
Connect:[email protected]
Desc:...
"""
Str1 = input('Str1: ')
Str2 = input('Str2: ')

for i in Str1:
    for j in Str2:
        if j == i:
            Str1 = Str1.replace(j,'')
print(Str1)

python编程—输入两个字符串,从第一字符串中删除第二个字符串中所有的字符

测试结果:
python编程—输入两个字符串,从第一字符串中删除第二个字符串中所有的字符

相关文章:

  • 2021-06-14
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-03-06
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-09-01
  • 2021-11-02
  • 2022-12-23
相关资源
相似解决方案