查找元素
#查找元素 >>> member=['张三','李四','王五','张麻子'] >>> member[0] '张三' #交换元素 >>> temp=member[0] >>> member[0]=member[1] >>> member[1]=temp >>> member ['李四', '张三', '王五', '张麻子']
删除元素
#remove()方法 >>> member=['张三','李四','王五','张麻子'] >>> member.remove('张三') >>> member ['李四', '王五', '张麻子'] del语句 >>> member=['张三','李四','王五','张麻子'] >>> del member[1] >>> member ['李四', '王五', '张麻子'] #pop()方法 >>> member=['张三','李四','王五','张麻子'] >>> member.pop() '张麻子' >>> name=member.pop(0) >>> name '李四' >>>