Check Array Is Sorted Or Not Python