Python Check If Variable Is An Array That Is In Sorted