###########列表操作################
# 定义列表:my_girl_friends=['alex','wupeiqi','yuanhao',4,5] #本质my_girl_friends=list([...])
# 或 l=list('abc')
#索引取值
# l=[1,2,3,4,5,6] #正向取值
# a=l[0:3:1] #顾头不顾尾 0-3 之间取 0 1 2 不到3 1为步长
# print (a)
# l=[1,2,3,4,5,6] #反向取值
# l[2::-1] #从开始正向2 取到 1 2 3 -1 从倒着开始第一取值 3 2 1
# l=[1,2,3,4,5,6] #全反
# l[::-1] #:: 任意区间 -1 倒着 反着取 [6,5,4,3,2,1]
#len 取列表长度
# stus=['alex','egon','www','aaa','ladasd']
# print(len(stus))
#成员运算 in 和 not in
# stus=['alex','egon','wxx','yxx','lxx']
# print('alex' in stus)
# print('alex' not in stus) 判断元素是否在列表里面
#追加
# stus=['alex','egon','wxx','yxx','lxx']
# stus.append('xxx')
# print (stus)
#插入
# stus=['alex','egon','wxx','yxx','lxx']
# stus.insert(0,'阿里渴死')
# print(stus)
#删除
# stus=['alex','egon','wxx','yxx','lxx']
# del stus[1]
# print(stus)
# stus.remove('alex')
# print(stus)
#循环
#依赖索引
# stus=['alex','egon','wxx','yxx','lxx']
# i=0
# while i < len(stus):
# print(stus[i])
# i+=1
#不依赖索引
# for item in stus:
# print(item)
# for i in range(len(stus)):
# print(i,stus[i])
#count 操作统计元素个数
# stus=['alex','egon','abcd','wxx','yxx','lxx']
# print(stus.count('alex'))
#extend扩展列表单个参数
# stus.extend(['a','b','c'])
# print(stus)
#append 整个列表加入
# stus=['alex','egon','abcd','wxx','yxx','lxx']
# stus.append(['a','b','c'])
# print (stus)
#取索引
# stus=['alex','egon','abcd','alex','wxx','yxx','lxx']
# print(stus.index('alex',1,5)) #取元素索引