# 末尾
a = [1,2,3]
a.append(4)
print(a)
# 場所指定 先頭は0
a.insert(1,15)
print(a)
a = [1, 2, 3, 4, 5]
print(a.pop())
print(a)
print(a.pop(1))
print(a)
a.remove(3)
print(a)
a = [1, 2]
b = [3, 4]
print(a+b)
print(a*2)
a = range(1,10)
print(a)
print([i*2 for i in a])
print([i*2 if i %2 == 0 else i*3 for i in a])
print([i*i if i%2 == 0 else i*i*i if i%3 == 0 else i*i*i*i*i if i%5 ==0 else i for i in a])
mylist = ["A", "B", "C"]
mylist[len(mylist):len(mylist)] = ["D", "E"]
print (mylist)
mylist[3:-1] = ["D", "E"]
print (mylist)