学习Python第三周
主要内容
- 字符串:使用单引号、双引号、三引号来标识字符串,引号内不能包含同种引号
- format格式化
- isupper()、islower()、isalpha()、isalnum()、isdight()、isspace()、istitle()
- 合并和隔离字符:jion(sep)
- 删除字符串头尾字符:
strip():头尾
lstrip():删除头部指定字符
rstrip():尾部
检测子串:find()、index() - 替换子串:replace
- 统计子串:count()
- 首字母大写:capitalize()
- 标题化():title()
10.内置函数:
字符最大值:max()
字符串长度len()
返回某个位置的字符char()
reversed()
给字符串排序sorted()
ord()