It will even be beneficial if you planned to use lists being a extra space economical dictionary in scenarios where by the keys are consecutive ints. Needless to say the existence of adverse indexing previously stops that.So if you don't want to make use of the safe_list_get Answer which I think is very good. Here are a few one liner if statements