python check if list out of range