# 创建列表 可迭代对象:能够for循环
l=[1,"hello",[4,5],{"name":"egon"}]
l2=list([1,23,3]) #l2=list((1,23,3))也行
l3=[1,22,3,43,43434,565,77]
l4={1,23}
print(l2)
print(type(l2))
print(l)
print(type(l))
# 查:截取(切片:)
print(l3[-2:])
#追加,一个一个加
print(l3)
print(l3.append("yuan"))
print(l3.append(7))
print(l3)
# extend想一次加几个都行
l3.extend([7,8])
print(l3)
l3.insert(2,"jjj")
print(l3)
# 删数据
l4.clear()
print(l4)
l3.count(3)
print(len(l3))
l5=[3,1,56,34]
l5.sort()
print(l5)
l5=["A","a","c","B"]
l5.sort(reverse=True) #顺序
print(l5)
sorted
l5.reverse() #顺序
print(l5)