How to get the nth element of a python list or a default if not available
- by xulochavez
Hi guys
I'm looking for an equivalent in python of dictionary.get(key, default) for lists. Is there any one liner idiom to get the nth element of a list or a default value if not available?
Thanks!