pythonbook/Python 基础教程/列表切片.py

11 lines
151 B
Python

# 列表切片
colors=["red","blue","green"]
colors[0] =="red"
colors[-1]=="green"
colors[1]=="blue"
aList = [3,5,7,9,11]
del aList[:3]
print(aList)