摘要: 字符串内置方法的使用 设置字符串:st=‘hello kitty’ 1、统计元素个数 Print(st.count(‘l’)) #结果为2 2、首字母大写 Print(st.capitalize()) #结果为Hello kitty 3、居中 Print(st.center(20,’#’)) #结果 阅读全文
posted @ 2017-09-02 20:39 xsan 阅读(451) 评论(0) 推荐(0) 编辑