摘要: 列表中存放的数据是可以修改的,比如“增”、“删”、“改” 添加元素(append,extend,insert) append:在列表的末尾进行添加 extend:可以将另一个集合中的元素逐一添加到列表中 insert:(index,object) 在指定位置index前插入元素object 修改元素 阅读全文
posted @ 2018-09-30 15:44 南航海军上校 阅读(180) 评论(0) 推荐(0)
摘要: 1 切片操作 >>> str="hello world!" >>> str[1:3] 'el' >>> str[:3] 'hel' >>> str[2:] 'llo world!' 2 不能直接改变字符串的值,更新字符串可以利用切片 >>> str="hello world!" >>> str1=s 阅读全文
posted @ 2018-09-30 14:34 南航海军上校 阅读(117) 评论(0) 推荐(0)