最佳答案
a = ['123', '2', 4]
b = a[4] or 'sss'
print b
I want to get a default value when the list index is out of range (here: 'sss'
).
How can I do this?