Python Check If Array Index Exists