Check If Index Exists In Array Python