If you are looking for a quick hack for reducing the code length characterwise, you can try this.
a=['123','2',4]
a.append('sss') #Default value
n=5 #Index you want to access
max_index=len(a)-1
b=a[min(max_index, n)]
print(b)
But this trick is only useful when you no longer want further modification to the list