Prevenir el índice de listas fuera de rango Python

m = [0,1]
try:
  m[3] = 9
except IndexError:
  pass
elcharitas