# filename:python2.25.py
# author:super
# date:2018-2-25
print('''today to learn the list's function''')
plays = ['aa', 'bb', 'cc', 'dd', 'ee']
print(plays[0:3])
print(plays[1:4])
print(plays[2:])
# 输入后三个的名字
print(plays[-3:])
# 遍历部分切片
for i in plays[:3]:
print(i)
# 当你想完全复制一个List的时候 要用[:] 来复制两个独立的list
# 如果用 = 来复制一个list ,其实是把两个变量指向了同一个列表
myfood = ['aa', 'bb', 'cc', 'zz']
friend_food = myfood[:]
print(friend_food)
myfood.append('ee')
friend_food.append('dd')
print(myfood)
print(friend_food)
mycar = ['ab', 'bc', 'cd']
friend_car = mycar
mycar.append('de')
friend_car.append('ef')
print(mycar)
print(friend_car)
# 元组的内容是不可以变的
dimension = (100, 200)
print(dimension)
# dimension[1] = 100
# print(dimension)
for i in dimension:
print(i)
# 想要让元组的内容不一样, 就要给元组赋予新的变量
dimension = (100, 400)
print(dimension)