摘要: count("x")统计字符串的元素的个数 a = "hello kitty" print (a.count("t"))#统计t出现的个数 输出结果: 2 endswith("x")判断以某个字符结尾 a = "python" print (a.endswith("n")) print (a.endswith("on")) print (a.endswith("hon")) print (a... 阅读全文
posted @ 2018-01-27 21:23 藤上小冬瓜 阅读(333) 评论(0) 推荐(0) 编辑