3-4~3-6
#3-4
lists = ["A","B","C","D","E"]
print(lists)
#3-5
lists.remove('B')
print(lists)
print(f"\nMr.B is too busy to join this activity")
#3-6
print("Lucky! Find a bigger table!" )
lists.remove('E')
lists.insert(0,'E')
print(lists)
lists.insert(2,'T')
print(lists)
lists.append('X')
print(lists)
3-7
print('I am sorry about only two guests can come this party')
for n in range(0,4):
number=1
number+=1
leave = lists.pop(number)
print(leave+" sorry for that you can not come party")
for n in range(0,2):
print("congratuation "+ lists[0] +" you can come party")
print(lists)
3-8
#3-8
places = ['Tokyo','London','San Diego','Beijing','New York']
print(places)
#
print(sorted(places))
#
print(places)
#
print(sorted(places,reverse=True))
#
print(places)
#
places.reverse()
print(places)
#
places.reverse()
print(places)
#
places.sort()
print(places)
#
places.sort(reverse=True)
print(places)
3-9
#3-9
print(len(lists))
3-10
#喜欢的美女
beauty = ['蒙嘉慧','蛇姐','林允儿','小茜','斋藤飞鸟','刘浩存']
#增加元素
beauty.append('冬宝')
print('我喜欢的人美女有')
print(beauty)
#插入元素
beauty.insert(3,'欢欢')
print('\n加了欢欢,现在我喜欢的美女有')
print(beauty)
#删除元素del
del beauty[4]
print('\n删了四号,现在喜欢的美女有')
print(beauty)
#删除元素pop
print('\n删除的美女是')
print(beauty.pop(5))
#删除元素remove
beauty.remove('斋藤飞鸟')
print('\n删除了斋藤飞鸟,现在喜欢的美女有')
print(beauty)
#对美女进行排序sort
beauty.sort()
print('\n对美女进行按字母排序')
print(beauty)
#对美女进行相反排序sorted
print('\n这是美女排序')
print(beauty)
print('这是现在美女的排序')
print(sorted(beauty,reverse=True))
print('这是原来的美女排序')
print(beauty)
#倒着打印reverse
beauty.reverse()
print('\n倒着打印美女排序')
print(beauty)
#确定长度
print('\n美女一共有')
print(len(beauty))