Python之序列(str、list、tuple)小结

python中的序列共性

1.每个对应值都有序号 index

'str'[0]

[1,2][0]

(1,2)[0]

2.len、max、min、index方法

3.+、*运算符

4.切片

'str'[0:2]

'str'[0:2:2]

 

5. in、not in判断是否包含

 

小灶 str可以进行max和min比较 ord()

'hello world'

ord('w') => 119

ord('d') => 110

ord(' ') => 32

posted @ 2020-06-10 23:00  前端小厨-美食博主  阅读(202)  评论(0编辑  收藏  举报