python index out of range exception code example
Example 1: expect out of range in pytnhon
try:
gotdata = dlist[1]
except IndexError:
gotdata = 'null'
Example 2: python list index out of range
#this will result in an IndexError
arr = ['item',1,None,'hi']
error = arr[10]