python字典和数组修改


test_zidian = {
'1':"张三",
'2':"李四",
'3':"王五",
'4':"四个",
}
test_zidian['5'] = "五大" 增加
test_zidian['5'] = "五大已被修改" 修改
test_zidian.pop('5')
del test_zidian['4'] 删除
test_zidian.get['3'] 查找

test_sz = ['a','b','c','d']
test_sz.append('e') 增加
test_sz[4] = 'eeee' 修改
test_sz.remove('d') 删除
test_sz.insert[4] = 'abc'
test_sz.insert(4,'abc') 插入
test_sz.index('abc',0,-1) 查找abc的序列位置
del test_sz[3] 删除


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM