字符串对象
1、什么是字符串
- 肉眼可以识别,具有特殊含义的字符组成串
2、python如何表示字符串(定义字符串)
-
弱数据类型语言的特性决定
- 单引号
- 双引号
- 三引号
-
str
- s = str(“字符串”)
3、字符串的常见方法
[‘add’, ‘class’, ‘contains’, ‘delattr’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘getitem’, ‘getnewargs’, ‘gt’, ‘hash’, ‘init’, ‘init_subclass’, ‘iter’, ‘le’, ‘len’, ‘lt’, ‘mod’, ‘mul’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’,