用字符串方法做文本处理
1:x=”Only those who have the patience to do simple things perfectly ever acquire the skill to do difficult things easily.”
2:y=”If you have great talents, industry will improve them; if you have but moderate abilities, industry will supply their deficiency.”
a:统计第一句英文中字符数量和单词数量,并给出单词to的索引;
b:将第二句中you换成someone;删除其中的if;
c:分别统计第一句中字符a, b, c, d, e, f, g的数量,并给出其中出现频率最高的字符;
e: 统计第一句中字符o出现的频数,以及占据字符串总长度的百分比;
f: 将第一句话转化为一个列表,每个单词为一个元素。
1:x=”Only those who have the patience to do simple things perfectly ever acquire the skill to do difficult things easily.”
2:y=”If you have great talents, industry will improve them; if you have but moderate abilities, industry will supply their deficiency.”
a:统计第一句英文中字符数量和单词数量,并给出单词to的索引;
b:将第二句中you换成someone;删除其中的if;
c:分别统计第一句中字符a, b, c, d, e, f, g的数量,并给出其中出现频率最高的字符;
e: 统计第一句中字符o出现的频数,以及占据字符串总长度的百分比;
f: 将第一句话转化为一个列表,每个单词为一个元素。
