📜  防止列表索引超出范围python代码示例

📅  最后修改于: 2022-03-11 14:45:42.752000             🧑  作者: Mango

代码示例1
m = [0,1]
try:
  m[3] = 9
except IndexError:
  pass