# li=['alex',[1,2,3],'wusir','egon','女神','taibai']
# l1=li[0]
# print(l1)
# l2=li[1]
# print(l2)
# l3=li[0:3]
# print(l3)
#li=['alex','wusir','egon','女神','taibai']
#增加append insert
# li.append('日天')
# li.append(1)
# print(li)
# while 1:
# username=input('>>>')
# if username.strip().upper()=='Q':
# break
# else:
# li.append(username)
# print(li)
# li.insert(4,'春哥')
# print(li)
# li.extend('二哥')
# print(li)
# li.extend([1,2,3])
# print(li)
#删
li=['taibai','alex','wusir','egon','女神']
# li.pop(1) #返回值
# name=li.pop()#默认删除最后一个
# print(li,name)
# li.remove('taibai')#按元素去删除
# print(li)
# li.clear()#清空
# print(li)
#del li
# del li[0:2] #切片去删除
# print(li)
# li[0]='男兽'
# li[0]=[1,2,3]
# li[0:2]='云姐'
# li[0:3]=[1,2,3,'春哥','咸鱼哥']
# print(li)
#查
# for i in li:
# print(i)
# print(li[0:2])
#公共方法
# l=len(li)#多少个元素
# print(l)
# num=li.count('taibai')#taibai出现的次数
# print(num)
# l=li.index('wusir')#找 wusir的索引
# print(l)
#li=[1,2,4,5,7,6,8,3,9]
#排序
# li.sort()#正向排序
# print(li)
# li.sort(reverse=True)#返向排序
# print(li)
# li.reverse()#反转
# print(li)
#列表的嵌套
# li=['taibia','武藤兰','苑吴',['alex','egon',89],23]
# l=li[1][1]#找出'武藤兰'里面的藤
# print(l)
# l1=li[0].capitalize()#找出taibai首字母大写
# li[2]='苑日天'
# print(li[2].replace('吴','ritian'))
# li[2]=li[2].replace('吴','ritian')
# print(li[2])
# li[3][0]=li[3][0].upper()
# print(li[3][0])
#元祖只读列表,可循环查询,可切片
#儿子不能改,孙子可能可以改
tu=(1,2,3,'alex',[2,3,4,'taibai'],'egon')
# print(tu[3])
# print(tu[0:4])
# for i in tu:
# print(i)
# tu[4][3]=tu[4][3].upper()
# print(tu)
# tu[4].append('sb')
# print(tu)
# s='alex'
# s1='sb'.join(s)
# print(s1)
#列表转换成字符串 list--->str join
# li=['taibai','alex','wusir','egon','女神']
# s='++++'.join(li)
#str--->list split()
# print(s)
#range [1.2.3...1000...]
# for i in range(3,10):
# print(i)
# for i in range(10):
# print(i)
# for i in range(0,10,3):
# print(i)
# for i in range(10,0,-2):
# print(i)
#li=[1,2,3,5,'alex',[2,3,4,5,'taibai'],'afds']
#li[5][4]=li[5][4].upper()
#print(li)
#列表
#增 : append insert extend
#删: remove pop clear del
#改: li[索引]='被修改的内容' li[切片]:'被修改的内容'
#查: for循环
# range
# 元祖
# len()
# li.index('元素')
# sort(reverse=True)
# li.sort()
# print(li.sort())
# reverse()反转
# ps:
# join:list--->str
# s.join(iterable)
# li=[1,2,3]
# s1=str(li)
# split:str--->list
lis=[2,3,'k',['qwe',20,['k',['tt',3,'1']],89],'ab','adv']
# (3) (2) (1) (0)
#将列表lis中的'tt'变成大写(用两种方式)
# lis[3][2][1][0]="TT"
# print(lis)
# lis[3][2][1][0]=lis[3][2][1][0].upper()
# print(lis)