统计字符串中去除某个字符的其他字符的数量并输出去除后的结果字符串
str1 = "qweqweasdsfaeasdassfasd" str2 = ("q") str3 = "" for i in str1: if i not in str2: str3 += i print(len(str3)) print(str3)