返回列表 發帖
l排序前: [12, -3, -50, 32, 25, 11]
排序後(遞增): [-50, -3, 11, 12, 25, 32]
排序後(遞減): [32, 25, 12, 11, -3, -50]
元素數量: 6
pop掉一元素 [32, 25, 12, 11, -3]
append一元素 [32, 25, 12, 11, -3, -20]
insert一元素 [32, 25, 12, 11, 0, -3, -20]

TOP

排序前: [12, -3, -50, 32, 25, 11]
排序後(遞增): [-50, -3, 11, 12, 25, 32]
排序後(遞減): [32, 25, 12, 11, -3, -50]
元素數量: 6
pop掉一元素 [32, 25, 12, 11, -3]
append一元素 [32, 25, 12, 11, -3, -20]
insert一元素 [32, 25, 12, 11, 0, -3, -20]

TOP

排序前: [12, -3, -50, 32, 25, 11]
排序後(遞增): [-50, -3, 11, 12, 25, 32]
排序後(遞減): [32, 25, 12, 11, -3, -50]
元素數量: 6
pop掉一元素 [32, 25, 12, 11, -3]
append一元素 [32, 25, 12, 11, -3, -20]
insert一元素 [32, 25, 12, 11, 0, -3, -20]

TOP

ist=[12,-3,-50,32,25,11]
print("排序前:",list)
list.sort()
print("排序後(遞增):",list)
list.reverse()
print("排序後(遞減):",list)
print("元素數量:",len(list))
list.pop()
print("pop掉一元素",list)
list.append(-20)
print("append一元素",list)
list.insert(4,0)
print("insert一元素",list)

TOP

ist=[12,-3,-50,32,25,11]
print("排序前:",list)
list.sort()
print("排序後(遞增):",list)
list.reverse()
print("排序後(遞減):",list)
print("元素數量:",len(list))
list.pop()
print("pop掉一元素",list)
list.append(-20)
print("append一元素",list)
list.insert(4,0)
print("insert一元素",list)

TOP

ist=[12,-3,-50,32,25,11]
print("排序前:",list)
list.sort()
print("排序後(遞增):",list)
list.reverse()
print("排序後(遞減):",list)
print("元素數量:",len(list))
list.pop()
print("pop掉一元素",list)
list.append(-20)
print("append一元素",list)
list.insert(4,0)
print("insert一元素",list)

TOP

list=[12,-3,-50,32,25,11]
print("排序前:",list)
list.sort()
print("排序後(遞增):",list)
list.reverse()
print("排序後(遞減):",list)
print("元素數量:",len(list))
list.pop()
print("pop掉一元素",list)
list.append(-20)
print("append一元素",list)
list.insert(4,0)
print("insert一元素",list)
複製代碼

TOP

返回列表