Python Array Check If Index Exists